microsoft / microsoft/WindowsAppSDK

MSTest Discovery Broken with 1.1.x

Open
#2,706 17 comments 2 reactions 1 assignee View on GitHub

@DefaultRyan is already working on this.

Since Jul 7, 2022.

area-DeveloperTools bug
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

After updating to 1.1.1/1.1.2 from 1.0.3 MSTest discovery is now broken. This is a blocking issue for us.

We couldn't test in our CI before because we were blocked by #2631 as well. I tried in the CI, but it seems there may have been something missed with the fix for #2631 as it's trying to install 1.1.1 still for MSTest, [see comment here](https://github.com/microsoft/WindowsAppSDK/issues/2631#issuecomment-1175456903) on that issue.

Locally I see the same behavior still I did with 1.1.1:

```
========== Starting test discovery ==========
[MSTest][Discovery][H:\...\tests\SizerBase.UnitTests.WinAppSdk\bin\x64\Debug\net6.0-windows10.0.19041.0\SizerBase.UnitTests.WinAppSdk.dll] Failed to discover tests from assembly H:\...\tests\SizerBase.UnitTests.WinAppSdk\bin\x64\Debug\net6.0-windows10.0.19041.0\SizerBase.UnitTests.WinAppSdk.dll. Reason:File does not exist: H:\...\tests\SizerBase.UnitTests.WinAppSdk\bin\x64\Debug\net6.0-windows10.0.19041.0\SizerBase.UnitTests.WinAppSdk.dll
No test is available in H:\...\tests\SizerBase.UnitTests.WinAppSdk\bin\x64\Debug\net6.0-windows10.0.19041.0\SizerBase.UnitTests.WinAppSdk.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
========== Test discovery finished: 0 Tests found in 5.1 sec ==========
```

The file exists on disk, everything built. Only change is updating NuGet reference from 1.0.3 to 1.1.x causes tests now to not be discovered properly/run.

### Steps to reproduce the bug

1. Create a MSTest based unit test project for WinAppSDK with 1.0.3
2. Run tests.
3. Close VS
4. Clean environment
5. Update to 1.1.x
6. Re-run tests (fail)

Note, you have to close VS/clean environment as VS caches test discovery, didn't detect this issue at first on initial update as VS used prior cache to run tests. Issue seems to be with test discovery itself.

### Expected behavior

Able to run MSTest projects as was able to with 1.0.3.

### Screenshots

_No response_

### NuGet package version

1.1.1

### Packaging type

_No response_

### Windows version

Windows 10 version 21H2 (19044, November 2021 Update)

### IDE

Visual Studio 2022

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.