diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 06:12:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 06:12:02 +0300 |
commit | 71154adca40dc0f8eb80dd1dc81d60ba92af4e99 (patch) | |
tree | 9128c829d09baf5af621218ab2d037fc8d39a2c2 /spec/workers/gitlab/github_import | |
parent | c9a3dc1c2464a92a8f2a5c2f4f30883aa9f976f1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/gitlab/github_import')
-rw-r--r-- | spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb | 20 | ||||
-rw-r--r-- | spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb | 10 |
2 files changed, 14 insertions, 16 deletions
diff --git a/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb b/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb index abba6cd7734..5d0cb05c8d5 100644 --- a/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb +++ b/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : it 'schedules a job in the future' do expect(described_class) .to receive(:perform_in) - .with(1.minute.to_i, 10, '123') + .with(5.minutes.to_i, 10, '123') described_class.perform_in_the_future(10, '123') end @@ -33,15 +33,20 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : allow(worker) .to receive(:find_import_state) .with(project.id) - .and_return(project) + .and_return(import_state) expect(Gitlab::SidekiqStatus) .to receive(:running?) .with('123') .and_return(true) - expect(project) - .to receive(:refresh_jid_expiration) + expect(Gitlab::SidekiqStatus) + .to receive(:expire) + .with('123', Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION) + + expect(Gitlab::SidekiqStatus) + .to receive(:set) + .with(import_state.jid, Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION) expect(worker.class) .to receive(:perform_in_the_future) @@ -63,8 +68,11 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : .with('123') .and_return(false) - expect(project) - .not_to receive(:refresh_jid_expiration) + expect(Gitlab::SidekiqStatus) + .not_to receive(:expire) + + expect(Gitlab::SidekiqStatus) + .not_to receive(:set) worker.perform(project.id, '123') end diff --git a/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb b/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb index f4a306eeb0c..020f7539bf4 100644 --- a/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb +++ b/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb @@ -10,16 +10,6 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportRepositoryWorker, feature_cate it_behaves_like Gitlab::GithubImport::StageMethods describe '#import' do - before do - expect(Gitlab::GithubImport::RefreshImportJidWorker) - .to receive(:perform_in_the_future) - .with(project.id, '123') - - expect(worker) - .to receive(:jid) - .and_return('123') - end - context 'when the import succeeds' do context 'with issues' do it 'schedules the importing of the base data' do |