Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet test does not find any tests if environment variable is set that ends with .dll or .exe #40848

Open
jbe2277 opened this issue May 13, 2024 · 2 comments
Labels
Area-DotNet Test untriaged Request triage from a team member

Comments

@jbe2277
Copy link

jbe2277 commented May 13, 2024

We use environment variables in UI tests to specify on our build machines where our application (executable) can be found.

dotnet test UITests/UITests.sln -e UITestExe="C:\OurApp.exe"

By defining an environment variable that ends on .exe or .dll the dotnet test does not find unit tests anymore.

Reason: In this case dotnet test searches the file specified as environment variable for unit tests.

It seems the the PR #28662 did not solve this completely.

Version:

.NET SDK:
 Version:           8.0.204
 Commit:            c338c7548c
 Workload version:  8.0.200-manifests.7d36c14f
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels May 13, 2024
@KalleOlaviNiemitalo
Copy link

Perhaps you can work around it by setting the environment variable with a directive instead, as shown in #40484.

@jbe2277
Copy link
Author

jbe2277 commented May 16, 2024

Yes, this works: dotnet [env:UITestExe="C:\OurApp.exe"] test UITests/UITests.sln

I did not find any information about this special syntax. Is this somewhere documented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DotNet Test untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants