Skip to content

Test run is marked as failed even though all tests pass. #298

Closed

Description

Description

While running our tests in VSTS using the Test Task, we see that the test run is marked as failed although all tests pass. We also see "Error: An item with the same key has already been added" during test discovery, potentially causing the problem

Steps to reproduce

Reference MSTest and TestAdaper 1.2 Nuget packages. Run tests with test filter in VSTS using Test Task definition.

Expected behavior

Tests run is successful as all tests pass.

Actual behavior

Test run is marked as failed though all tests pass. Before the tests start executing we see a bunch of:

Warning: No test is available in Test0.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

2017-10-25T06:00:23.9975712Z Warning: No test is available in Test1.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

2017-10-25T06:00:24.0600773Z Warning: No test is available in Test2.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

2017-10-25T06:00:24.3257236Z Error: An item with the same key has already been added.
...
...
2017-10-25T06:09:44.9663699Z Total tests: 39. Passed: 39. Failed: 0. Skipped: 0.
2017-10-25T06:09:44.9663699Z Test Run Failed.
2017-10-25T06:09:44.9663699Z Test execution time: 9.4706 Minutes
2017-10-25T06:09:45.0445030Z Results File: C:\BA\r1\a\TestResults\TestResults.trx
2017-10-25T06:09:45.3883132Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2017-10-25T06:09:45.6539600Z ##[error]Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe failed with return code: 1
2017-10-25T06:09:46.9822206Z ##[error]Vstest exited with return code: 2.

Environment

The tests are being in VSTS using the Test Task definition.
The test target .Net framework 4.6.2.
We run the tests based on test filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions