Commit 51aa7028 authored by Erick Bajao's avatar Erick Bajao

Refactor specs and add documentation

parent 0ae3fc6b
......@@ -316,13 +316,23 @@ If JUnit report format XML files are generated and uploaded as part of a pipelin
can be viewed inside the pipelines details page. The **Tests** tab on this page will
display a list of test suites and cases reported from the XML file.
![Test Reports Widget](img/pipelines_junit_test_report_ui_v12_5.png)
![Test Reports Widget](img/pipelines_junit_test_report_v13_10.png)
You can view all the known test suites and click on each of these to see further
details, including the cases that make up the suite.
You can also retrieve the reports via the [GitLab API](../api/pipelines.md#get-a-pipelines-test-report).
### Unit test reports parsing errors
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/263457) in GitLab 13.10.
If parsing JUnit report XML results in an error, an indicator will be shown next to the job name. Hovering over the icon will show the parser error in a tooltip. In case of multiple parsing errors coming from [grouped jobs](jobs/index.md#group-jobs-in-a-pipeline), we will only show the first error from the group.
![Test Reports With Errors](img/pipelines_junit_test_report_with_errors_v13_10.png)
In case there are multiple parsing errors from [grouped jobs](jobs/index.md#group-jobs-in-a-pipeline), we will only show the first error from the group.
## Viewing JUnit screenshots on GitLab
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/202114) in GitLab 13.0.
......
......@@ -10,13 +10,17 @@ RSpec.describe Ci::BuildReportResultService do
let(:build) { create(:ci_build, :success, :test_reports) }
it 'creates a build report result entry', :aggregate_failures do
expect { build_report_result }.to change { Ci::BuildReportResult.count }.by(1)
expect(build_report_result.tests_name).to eq("test")
expect(build_report_result.tests_success).to eq(2)
expect(build_report_result.tests_failed).to eq(2)
expect(build_report_result.tests_errored).to eq(0)
expect(build_report_result.tests_skipped).to eq(0)
expect(build_report_result.tests_duration).to eq(0.010284)
expect(Ci::BuildReportResult.count).to eq(1)
end
it 'tracks unique test cases parsed' do
build_report_result
unique_test_cases_parsed = Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(
event_names: described_class::EVENT_NAME,
......@@ -30,6 +34,7 @@ RSpec.describe Ci::BuildReportResultService do
let(:build) { create(:ci_build, :success, :broken_test_reports) }
it 'creates a build report result entry with suite error', :aggregate_failures do
expect { build_report_result }.to change { Ci::BuildReportResult.count }.by(1)
expect(build_report_result.tests_name).to eq("test")
expect(build_report_result.tests_success).to eq(0)
expect(build_report_result.tests_failed).to eq(0)
......@@ -37,7 +42,10 @@ RSpec.describe Ci::BuildReportResultService do
expect(build_report_result.tests_skipped).to eq(0)
expect(build_report_result.tests_duration).to eq(0)
expect(build_report_result.suite_error).to be_present
expect(Ci::BuildReportResult.count).to eq(1)
end
it 'does not track unique test cases parsed' do
build_report_result
unique_test_cases_parsed = Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(
event_names: described_class::EVENT_NAME,
......
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