2020-05-29 17:08:35 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :ci_build_report_result, class: 'Ci::BuildReportResult' do
|
|
|
|
build factory: :ci_build
|
|
|
|
project factory: :project
|
2021-03-12 16:09:12 -05:00
|
|
|
|
|
|
|
transient do
|
|
|
|
test_suite_name { "rspec" }
|
|
|
|
end
|
|
|
|
|
2020-05-29 17:08:35 -04:00
|
|
|
data do
|
|
|
|
{
|
2020-06-02 17:08:00 -04:00
|
|
|
tests: {
|
2021-03-12 16:09:12 -05:00
|
|
|
name: test_suite_name,
|
2020-05-29 17:08:35 -04:00
|
|
|
duration: 0.42,
|
|
|
|
failed: 0,
|
|
|
|
errored: 2,
|
|
|
|
skipped: 0,
|
|
|
|
success: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :with_junit_success do
|
|
|
|
data do
|
|
|
|
{
|
2020-06-02 17:08:00 -04:00
|
|
|
tests: {
|
2021-03-12 16:09:12 -05:00
|
|
|
name: test_suite_name,
|
2020-05-29 17:08:35 -04:00
|
|
|
duration: 0.42,
|
|
|
|
failed: 0,
|
|
|
|
errored: 0,
|
|
|
|
skipped: 0,
|
|
|
|
success: 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2021-03-12 16:09:12 -05:00
|
|
|
|
|
|
|
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
|
2020-05-29 17:08:35 -04:00
|
|
|
end
|
|
|
|
end
|