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:
Diffstat (limited to 'spec/factories/ci/build_report_results.rb')
-rw-r--r--spec/factories/ci/build_report_results.rb29
1 files changed, 27 insertions, 2 deletions
diff --git a/spec/factories/ci/build_report_results.rb b/spec/factories/ci/build_report_results.rb
index 0685c0e5554..7d716d6d81a 100644
--- a/spec/factories/ci/build_report_results.rb
+++ b/spec/factories/ci/build_report_results.rb
@@ -4,10 +4,15 @@ FactoryBot.define do
factory :ci_build_report_result, class: 'Ci::BuildReportResult' do
build factory: :ci_build
project factory: :project
+
+ transient do
+ test_suite_name { "rspec" }
+ end
+
data do
{
tests: {
- name: "rspec",
+ name: test_suite_name,
duration: 0.42,
failed: 0,
errored: 2,
@@ -21,7 +26,7 @@ FactoryBot.define do
data do
{
tests: {
- name: "rspec",
+ name: test_suite_name,
duration: 0.42,
failed: 0,
errored: 0,
@@ -31,5 +36,25 @@ FactoryBot.define do
}
end
end
+
+ trait :with_junit_suite_error do
+ transient do
+ test_suite_error { "some error" }
+ end
+
+ data do
+ {
+ tests: {
+ name: test_suite_name,
+ duration: 0.42,
+ failed: 0,
+ errored: 0,
+ skipped: 0,
+ success: 2,
+ suite_error: test_suite_error
+ }
+ }
+ end
+ end
end
end