diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /spec/requests/api/ci/jobs_spec.rb | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'spec/requests/api/ci/jobs_spec.rb')
-rw-r--r-- | spec/requests/api/ci/jobs_spec.rb | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/spec/requests/api/ci/jobs_spec.rb b/spec/requests/api/ci/jobs_spec.rb index 875bfc5b94f..10dd9c3b556 100644 --- a/spec/requests/api/ci/jobs_spec.rb +++ b/spec/requests/api/ci/jobs_spec.rb @@ -126,6 +126,7 @@ RSpec.describe API::Ci::Jobs, feature_category: :continuous_integration do it 'returns specific job data' do expect(json_response['finished_at']).to be_nil + expect(json_response['erased_at']).to be_nil end it 'avoids N+1 queries', :skip_before_request do @@ -540,21 +541,6 @@ RSpec.describe API::Ci::Jobs, feature_category: :continuous_integration do expect(json_response.first['id']).to eq(job.id) expect(response.headers).not_to include("Link") end - - context 'with :jobs_api_keyset_pagination disabled' do - before do - stub_feature_flags(jobs_api_keyset_pagination: false) - end - - it 'defaults to offset pagination' do - get api("/projects/#{project.id}/jobs", api_user), params: { pagination: 'keyset', per_page: 1 } - - expect(response).to have_gitlab_http_status(:ok) - expect(json_response.size).to eq(1) - expect(json_response.first['id']).to eq(running_job.id) - expect(response.headers["Link"]).not_to include("cursor") - end - end end describe 'GET /projects/:id/jobs rate limited' do @@ -651,6 +637,18 @@ RSpec.describe API::Ci::Jobs, feature_category: :continuous_integration do end end + context 'when job is erased' do + let(:job) do + create(:ci_build, pipeline: pipeline, erased_at: Time.now) + end + + it 'returns specific job data' do + get api("/projects/#{project.id}/jobs/#{job.id}", api_user) + + expect(Time.parse(json_response['erased_at'])).to be_like_time(job.erased_at) + end + end + context 'when trace artifact record exists with no stored file', :skip_before_request do before do create(:ci_job_artifact, :unarchived_trace_artifact, job: job, project: job.project) |