Review test results
Azure Pipelines | TFS 2018 | TFS 2017 | TFS 2015
Automated tests can be configured to run as part of a build or release for various languages. Test reports provide an effective and consistent way to view the tests results executed using different test frameworks, in order to measure pipeline quality, review traceability, troubleshoot failures and drive failure ownership. In addition, it provides many advanced reporting capabilities explored in the following sections.
Read the glossary to understand test report terminology.
In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build and release pipelines are called definitions, service connections are called service endpoints, stages are called environments, and jobs are called phases.
Published test results can be viewed in the Tests tab in a build or release summary.
Test report is available in TFS 2015 and above, however the new experience described in this document is available only with Azure Pipelines at present.
View test results in build
The build summary provides a timeline view of the key steps executed in the build. If tests were executed and reported as part of the build, a test milestone appears in the timeline view. The test milestone provides a summary of the test results as a measure of pass percentage along with indicators for failures and aborts if these exist.
View test results in release
In the pipeline view you can see all the stages and associated tests. The view provides a summary of the test results as a measure of pass percentage along with indicators for failures and aborts if these exist. These indicators are same as in the build timeline view, giving a consistent experience across build and release.
Both the build and release summaries provide details of test execution. Choose Test summary to view the details in the Tests tab. This page has the following sections
Summary: provides key quantitative metrics for the test execution such as the total test count, failed tests, pass percentage, and more. It also provides differential indicators of change compared to the previous execution.
Results: lists all tests executed and reported as part of the current build or release. The default view shows only the failed and aborted tests in order to focus on tests that require attention. However, you can choose other outcomes using the filters provided.
Details: A list of tests that you can sort, group, search, and filter to find the test results you need.
Select any test run or result to view the details pane that displays additional information required for troubleshooting such as the error message, stack trace, attachments, work items, historical trend, and more.
The following capabilities of the Tests tab help to improve productivity and troubleshooting experience.
Filter large test results
Over time, tests accrue and, for large applications, can easily grow to tens of thousands of tests. For these applications with very many tests, it can be hard to navigate through the results to identify test failures, associate root causes, or get ownership of issues. Filters make it easy to quickly navigate to the test results of your interest. You can filter on Test Name, Outcome (failed, passed, and more), Test Files (files holding tests) and Owner (for test files). All of the filter criteria are cumulative in nature.
Additionally, with multiple Grouping options such as Test run, Test file, Priority, Requirement, and more, you can organize the Results view exactly as you require.
Immersive troubleshooting experience
Error messages and stack traces are lengthy in nature and need enough real estate to view the details during troubleshooting. To provide an immersive troubleshooting experience, the Details view can be expanded to full page view while still being able to perform the required operations in context, such as bug creation or requirement association for the selected test result.
Test trends with historical data
History of test execution can provide meaningful insights into reliability or performance of tests. When troubleshooting a failure, it is valuable to know how a test has performed in the past. The Tests tab provides test history in context with the test results. The test history information is exposed in a progressive manner starting with the current build pipeline to other branches, or the current stage to other stages, for build and release respectively.
View execution of in-progress tests
Tests, such as integration and functional tests, can run for a long time. Therefore, it is important to see the current or near real-time status of test execution at any given time. Even for cases where tests run quickly, it's useful to know the status of the relevant test result(s) as early as possible; especially when failures occur. The in-progress view eliminates the need to wait for test execution to finish. Results are available in near real-time as execution progresses, helping you to take actions faster. You can debug a failure, file a bug, or abort the pipeline.
The feature is currently available for both build and release, using Visual Studio Test task in a Multi Agent job. It will be available for Single Agent jobs in a future release.
The view below shows the in-progress test summary in a release, reporting the total test count and the number of test failures at a given point in time. The test failures are available for troubleshooting, creating bug(s), or to take any other appropriate action.
View summarized test results
During test execution, a test might spawn multiple instances or tests that contribute to the overall outcome. Some examples are, tests that are rerun, tests composed of an ordered combination of other tests (ordered tests) or tests having different instances based on an input parameter (data driven tests).
As these tests are related, they must be reported together with the overall outcome derived from the individual instances or tests. These test results are reported as a summarized test result in the Tests tab:
Rerun failed tests: The ability to rerun failed tests is available in the latest version of the Visual Studio Test task. During a rerun, multiple attempts can be made for a failed test, and each failure could have a different root cause due to the non-deterministic behavior of the test. Test reports provide a combined view for all the attempts of a rerun, along with the overall test outcome as a summarized unit. Additionally the Test Management API(s) now support the ability to publish and query summarized test results.
Data driven tests: Similar to the rerun of failed tests, all iterations of data driven tests are reported under that test. The summarized result view for data driven tests depends on the behavior of the test framework. If the framework produces a hierarchy of results (for example, MSTest v1 and v2) they will be reported in a summarized view. If the framework produces individual results for each iteration (for example, xUnit) they will not be grouped together. The summarized view is also available for ordered tests (.orderedtest in Visual Studio).
Metrics in the test summary section, such as the total number of tests, passed, failed, or other are computed using the root level of the summarized test result.
View aborted tests
Test execution can abort due to several reasons such as bad test code, errors in the source under test, or environmental issues. Irrespective of the reason for the abort, it is important to be able to diagnose the behavior and identify the root cause. The aborted tests and test runs can be viewed alongside the completed runs in the Tests tab.
The feature is currently available for both build and release, using the Visual Studio Test task in a Multi Agent job or publishing test results using the Test Management API(s). It will be available for Single Agent jobs in a future release.
Surface test results in the Tests tab
Tests results can be surfaced in the Tests tab using one of the following options:
Test execution tasks: built-in test execution tasks such as Visual Studio Test that automatically publish test results to the pipeline, or others such as Ant, Maven, Gulp, Grunt, and Xcode that provide this capability as an option within the task.
Publish Test Results task: publishes test results to Azure Pipelines or TFS when tests are executed using your choice of runner, and results are available in any of the supported test result formats.
API(s): test results published directly using the Test Management API(s).
Surface test information beyond the Tests tab
The Tests tab provides a detailed summary of the test execution. This is helpful in tracking the quality of the pipeline, as well as troubleshooting failures. Azure DevOps also provides other ways to surface the test information:
The Dashboard provides visibility into your team's is progress. Add one or more widgets that surface test related information:
Test analytics provides rich insights into test results measured over a period of time. It can help identify problematic areas in your test by providing data such as the top failing tests, and more.