Commit d4bd7d1d authored by Maxime Orefice's avatar Maxime Orefice

Unify test suite total_count

This MR unify the way we calculate the number of total
tests for a given suite.
parent 5db770df
......@@ -28,7 +28,7 @@ module Gitlab
def total_count
return 0 if suite_error
test_cases.values.sum(&:count)
[success_count, failed_count, skipped_count, error_count].sum
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -50,9 +50,11 @@ RSpec.describe Gitlab::Ci::Reports::TestSuite do
before do
test_suite.add_test_case(test_case_success)
test_suite.add_test_case(test_case_failed)
test_suite.add_test_case(test_case_skipped)
test_suite.add_test_case(test_case_error)
end
it { is_expected.to eq(2) }
it { is_expected.to eq(4) }
end
describe '#total_status' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment