Some test scripts don't work correctly #11692

Closed
opened 2026-01-31 02:54:55 +00:00 by claunia · 4 comments
Owner

Originally created by @j4james on GitHub (Dec 3, 2020).

Environment

Windows build number: Version 10.0.18363.1198
Windows Terminal version (if applicable): Commit 62131720aa

Steps to reproduce

  1. In a cmd shell, change to the tools directory.
  2. Setup the build environment by running razzle.cmd
  3. Produce a release build by running bz.cmd rel
  4. Attempt to run the feature tests: runft.cmd
  5. Attempt to run the Terminal Core unit tests: runut /name:TerminalCore*

Expected behavior

The tests should run.

Actual behavior

The feature tests fail with the following errors:

Warning: TAEF: The test file "C:\terminal\bin\x64\Debug\ConHost.Feature.Tests.dll" does not exist.
Error: TAEF: None of the specified test files were found.

The unit tests fail with the following errors:

Warning: TAEF: The test file "C:\terminal\bin\x64\Release\Terminal.Core.Unit.Tests.dll" does not exist.
Error: TAEF: The selection criteria did not match any tests.
Error: TAEF: No test cases were executed.

The runft error is simply a result of the script being hardcoded to test a Debug build.
ae550e0969/tools/runft.cmd (L7)

We just need to change that Debug to %_LAST_BUILD_CONF% to make it work with both debug and release builds.

The runut error is the result of the path of Terminal.Core.Unit.Tests.dll being incorrect.
ae550e0969/tools/runut.cmd (L19)

That can be fixed by changing that line to:

%OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll ^

That said, I'm note positive that's the right solution, because it used to work with the current path. I can't remember when exactly it first broke, but I'm assuming it was the result of a change in the project structure. If that change wasn't intentional then maybe it's the project that needs correcting instead of updating the test script.

Originally created by @j4james on GitHub (Dec 3, 2020). # Environment Windows build number: Version 10.0.18363.1198 Windows Terminal version (if applicable): Commit 62131720aa7a95df7ed397801c373d4eab0fd3d6 # Steps to reproduce 1. In a cmd shell, change to the tools directory. 2. Setup the build environment by running `razzle.cmd` 3. Produce a release build by running `bz.cmd rel` 4. Attempt to run the feature tests: `runft.cmd` 5. Attempt to run the Terminal Core unit tests: `runut /name:TerminalCore*` # Expected behavior The tests should run. # Actual behavior The feature tests fail with the following errors: ``` Warning: TAEF: The test file "C:\terminal\bin\x64\Debug\ConHost.Feature.Tests.dll" does not exist. Error: TAEF: None of the specified test files were found. ``` The unit tests fail with the following errors: ``` Warning: TAEF: The test file "C:\terminal\bin\x64\Release\Terminal.Core.Unit.Tests.dll" does not exist. Error: TAEF: The selection criteria did not match any tests. Error: TAEF: No test cases were executed. ``` The `runft` error is simply a result of the script being hardcoded to test a `Debug` build. https://github.com/microsoft/terminal/blob/ae550e0969595f062b15c2ff5cc33d4afe8ebc3f/tools/runft.cmd#L7 We just need to change that `Debug` to `%_LAST_BUILD_CONF%` to make it work with both debug and release builds. The `runut` error is the result of the path of `Terminal.Core.Unit.Tests.dll` being incorrect. https://github.com/microsoft/terminal/blob/ae550e0969595f062b15c2ff5cc33d4afe8ebc3f/tools/runut.cmd#L19 That can be fixed by changing that line to: ``` %OPENCON%\bin\%PLATFORM%\%_LAST_BUILD_CONF%\UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll ^ ``` That said, I'm note positive that's the right solution, because it used to work with the current path. I can't remember when exactly it first broke, but I'm assuming it was the result of a change in the project structure. If that change wasn't intentional then maybe it's the project that needs correcting instead of updating the test script.
Author
Owner

@zadjii-msft commented on GitHub (Dec 3, 2020):

No, you're definitely right about the unit tests thing. We pretty recently unified our project structures, so things get binplaced in more sensible locations, but clearly didn't update all our tooling. @DHowett did it recently, but I'm too lazy to dig out which PR exactly.

As far as feature tests go, I think it's pretty clear we don't run those locally enough. We can barely get the to pass in CI 😝

@zadjii-msft commented on GitHub (Dec 3, 2020): No, you're definitely right about the unit tests thing. We pretty recently unified our project structures, so things get binplaced in more sensible locations, but clearly didn't update _all_ our tooling. @DHowett did it recently, but I'm too lazy to dig out which PR exactly. As far as feature tests go, I think it's pretty clear we don't run those locally enough. We can barely get the to pass in CI 😝
Author
Owner

@j4james commented on GitHub (Dec 3, 2020):

The tests do actually work reasonably well when run locally. I'm used to the fact that some of them are always bound to be broken, but they're still useful to me as a way to confirm that I haven't introduced new breaks before submitting a PR. It was just becoming a bit of pain always having to patch the batch files when I wanted to test.

@j4james commented on GitHub (Dec 3, 2020): The tests do actually work reasonably well when run locally. I'm used to the fact that some of them are always bound to be broken, but they're still useful to me as a way to confirm that I haven't introduced new breaks before submitting a PR. It was just becoming a bit of pain always having to patch the batch files when I wanted to test.
Author
Owner

@Don-Vito commented on GitHub (Dec 3, 2020):

Actually the tests work much better locally than in CI 😄
I always run them before PR as well.. but the paths are screwed lately.. so not to patch the batch files I have another batch that copies the dlls to the expected locations 😊

@Don-Vito commented on GitHub (Dec 3, 2020): Actually the tests work much better locally than in CI :smile: I always run them before PR as well.. but the paths are screwed lately.. so not to patch the batch files I have another batch that copies the dlls to the expected locations :blush:
Author
Owner

@DHowett commented on GitHub (Dec 3, 2020):

Gah, sorry I moved all the files around and didn’t update the test scripts. Shows you how well I know our own tools 😄

@DHowett commented on GitHub (Dec 3, 2020): Gah, sorry I moved all the files around and didn’t update the test scripts. Shows you how well I know our own tools :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11692