Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-28 21:10:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-28 21:10:01 +0300
commitf14814c9815f86a95808f089ff219d4e768641c0 (patch)
treebca9f6f2719c693748479776b766786922b026e2 /spec/workers/container_registry
parentf7f0c0502763777f48964774a87b0a34dfb1d9ab (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/container_registry')
-rw-r--r--spec/workers/container_registry/migration/enqueuer_worker_spec.rb41
1 files changed, 32 insertions, 9 deletions
diff --git a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb
index a8f13958681..dbac36e50d5 100644
--- a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb
+++ b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb
@@ -65,19 +65,23 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
end
end
- it 'starts the pre-import for the next qualified repository' do
- expect_log_extra_metadata(
- import_type: 'next',
- container_repository_id: container_repository.id,
- container_repository_path: container_repository.path,
- container_repository_migration_state: 'pre_importing'
- )
+ shared_examples 'starting the next import' do
+ it 'starts the pre-import for the next qualified repository' do
+ expect_log_extra_metadata(
+ import_type: 'next',
+ container_repository_id: container_repository.id,
+ container_repository_path: container_repository.path,
+ container_repository_migration_state: 'pre_importing'
+ )
- subject
+ subject
- expect(container_repository.reload).to be_pre_importing
+ expect(container_repository.reload).to be_pre_importing
+ end
end
+ it_behaves_like 'starting the next import'
+
context 'when the new pre-import maxes out the capacity' do
before do
# set capacity to 10
@@ -97,6 +101,18 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
end
it_behaves_like 're-enqueuing based on capacity'
+
+ context 'max tag count is 0' do
+ before do
+ stub_application_setting(container_registry_import_max_tags_count: 0)
+ # Add 8 tags to the next repository
+ stub_container_registry_tags(
+ repository: container_repository.path, tags: %w(a b c d e f g h), with_manifest: true
+ )
+ end
+
+ it_behaves_like 'starting the next import'
+ end
end
context 'migrations are disabled' do
@@ -311,4 +327,11 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
end
end
end
+
+ describe 'worker attributes' do
+ it 'has deduplication set' do
+ expect(described_class.get_deduplicate_strategy).to eq(:until_executing)
+ expect(described_class.get_deduplication_options).to include(ttl: 30.minutes)
+ end
+ end
end