summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-16 18:08:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-16 18:08:34 +0000
commitcc9ff71e31ecc954f819741ba1285b1b9adbf3b9 (patch)
tree5f1ff13cc95f2b1860419c45b8def31cde56d1f9 /spec/factories
parentf01d3c8c095e70981ffc1d20c050c153f3766421 (diff)
downloadgitlab-ce-cc9ff71e31ecc954f819741ba1285b1b9adbf3b9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/bulk_import/batch_trackers.rb37
-rw-r--r--spec/factories/bulk_import/export_batches.rb23
-rw-r--r--spec/factories/integrations.rb9
3 files changed, 69 insertions, 0 deletions
diff --git a/spec/factories/bulk_import/batch_trackers.rb b/spec/factories/bulk_import/batch_trackers.rb
new file mode 100644
index 00000000000..427eefc5f3e
--- /dev/null
+++ b/spec/factories/bulk_import/batch_trackers.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :bulk_import_batch_tracker, class: 'BulkImports::BatchTracker' do
+ association :tracker, factory: :bulk_import_tracker
+
+ status { 0 }
+ fetched_objects_count { 1000 }
+ imported_objects_count { 1000 }
+
+ sequence(:batch_number) { |n| n }
+
+ trait :created do
+ status { 0 }
+ end
+
+ trait :started do
+ status { 1 }
+ end
+
+ trait :finished do
+ status { 2 }
+ end
+
+ trait :timeout do
+ status { 3 }
+ end
+
+ trait :failed do
+ status { -1 }
+ end
+
+ trait :skipped do
+ status { -2 }
+ end
+ end
+end
diff --git a/spec/factories/bulk_import/export_batches.rb b/spec/factories/bulk_import/export_batches.rb
new file mode 100644
index 00000000000..4339b02d27e
--- /dev/null
+++ b/spec/factories/bulk_import/export_batches.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :bulk_import_export_batch, class: 'BulkImports::ExportBatch' do
+ association :export, factory: :bulk_import_export
+
+ upload { association(:bulk_import_export_upload) }
+
+ status { 0 }
+
+ trait :started do
+ status { 0 }
+ end
+
+ trait :finished do
+ status { 1 }
+ end
+
+ trait :failed do
+ status { -1 }
+ end
+ end
+end
diff --git a/spec/factories/integrations.rb b/spec/factories/integrations.rb
index 5a666e57ad1..caeac6e3b92 100644
--- a/spec/factories/integrations.rb
+++ b/spec/factories/integrations.rb
@@ -274,6 +274,15 @@ FactoryBot.define do
service_account_key { File.read('spec/fixtures/service_account.json') }
end
+ factory :squash_tm_integration, class: 'Integrations::SquashTm' do
+ project
+ active { true }
+ type { 'Integrations::SquashTm' }
+
+ url { 'https://url-to-squash.com' }
+ token { 'squash_tm_token' }
+ end
+
# this is for testing storing values inside properties, which is deprecated and will be removed in
# https://gitlab.com/gitlab-org/gitlab/issues/29404
trait :without_properties_callback do