summaryrefslogtreecommitdiff
path: root/spec/factories/ci/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/test_case.rb')
-rw-r--r--spec/factories/ci/test_case.rb39
1 files changed, 3 insertions, 36 deletions
diff --git a/spec/factories/ci/test_case.rb b/spec/factories/ci/test_case.rb
index 7f99f0e123e..601a3fae970 100644
--- a/spec/factories/ci/test_case.rb
+++ b/spec/factories/ci/test_case.rb
@@ -1,41 +1,8 @@
# frozen_string_literal: true
FactoryBot.define do
- factory :test_case, class: 'Gitlab::Ci::Reports::TestCase' do
- suite_name { "rspec" }
- name { "test-1" }
- classname { "trace" }
- file { "spec/trace_spec.rb" }
- execution_time { 1.23 }
- status { Gitlab::Ci::Reports::TestCase::STATUS_SUCCESS }
- system_output { nil }
- attachment { nil }
- association :job, factory: :ci_build
-
- trait :failed do
- status { Gitlab::Ci::Reports::TestCase::STATUS_FAILED }
- system_output { "Failure/Error: is_expected.to eq(300) expected: 300 got: -100" }
- end
-
- trait :failed_with_attachment do
- status { Gitlab::Ci::Reports::TestCase::STATUS_FAILED }
- attachment { "some/path.png" }
- end
-
- skip_create
-
- initialize_with do
- new(
- suite_name: suite_name,
- name: name,
- classname: classname,
- file: file,
- execution_time: execution_time,
- status: status,
- system_output: system_output,
- attachment: attachment,
- job: job
- )
- end
+ factory :ci_test_case, class: 'Ci::TestCase' do
+ project
+ key_hash { Digest::SHA256.hexdigest(SecureRandom.hex) }
end
end