diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb')
-rw-r--r-- | spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb b/spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb index 41487e9ea48..6a715312097 100644 --- a/spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb +++ b/spec/services/projects/refresh_build_artifacts_size_statistics_service_spec.rb @@ -52,6 +52,12 @@ RSpec.describe Projects::RefreshBuildArtifactsSizeStatisticsService, :clean_gitl expect { service.execute }.to change { refresh.reload.last_job_artifact_id.to_i }.to(artifact_3.id) end + it 'updates the last_job_artifact_id to the ID of the last artifact from the project' do + expect { service.execute } + .to change { refresh.reload.last_job_artifact_id_on_refresh_start.to_i } + .to(project.job_artifacts.last.id) + end + it 'requeues the refresh job' do service.execute expect(refresh.reload).to be_pending @@ -63,7 +69,8 @@ RSpec.describe Projects::RefreshBuildArtifactsSizeStatisticsService, :clean_gitl :project_build_artifacts_size_refresh, :pending, project: project, - last_job_artifact_id: artifact_3.id + last_job_artifact_id: artifact_3.id, + last_job_artifact_id_on_refresh_start: artifact_4.id ) end @@ -77,6 +84,10 @@ RSpec.describe Projects::RefreshBuildArtifactsSizeStatisticsService, :clean_gitl expect(refresh.reload.last_job_artifact_id).to eq(artifact_3.id) end + it 'keeps the last_job_artifact_id_on_refresh_start unchanged' do + expect(refresh.reload.last_job_artifact_id_on_refresh_start).to eq(artifact_4.id) + end + it 'keeps the state of the refresh record at running' do expect(refresh.reload).to be_running end |