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

Can't opt out of VSTestUseMSBuildOutput in project file #39127

Open
sbomer opened this issue Feb 29, 2024 · 5 comments
Open

Can't opt out of VSTestUseMSBuildOutput in project file #39127

sbomer opened this issue Feb 29, 2024 · 5 comments
Labels
Area-DotNet Test untriaged Request triage from a team member

Comments

@sbomer
Copy link
Member

sbomer commented Feb 29, 2024

Run dotnet test on a project that has the following property set:

<VSTestUseMSBuildOutput>False</VSTestUseMSBuildOutput>

This still uses the MSBuild terminal logger output for VSTest (which is broken in preview 1).

Further technical details

I believe the reason for this is that dotnet test passes --property:VsTestUseMSBuildOutput=true by default at

additionalBuildProperties = ["--property:VsTestUseMSBuildOutput=true"];

This global property setting overrides anything in the project file. I think dotnet test should not be passing this; instead, the default better belongs in the MSBuild logic owned by VSTest.

 Version:           9.0.100-preview.1.24101.2
 Commit:            6bbd460f4d
 Workload version:  9.0.100-manifests.c840f51f

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  23.10
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /home/svbomer/src/runtime/.dotnet/sdk/9.0.100-preview.1.24101.2/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      9.0.0-preview.1.24080.9
  Architecture: x64
  Commit:       1d1bf92fcf

.NET SDKs installed:
  9.0.100-preview.1.24101.2 [/home/svbomer/src/runtime/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.1.24081.5 [/home/svbomer/src/runtime/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.1.24080.9 [/home/svbomer/src/runtime/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  /home/svbomer/src/runtime/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels Feb 29, 2024
@sbomer
Copy link
Member Author

sbomer commented Feb 29, 2024

@nohwnd this might be a candidate for tracking as part of microsoft/vstest#4843.

@nohwnd
Copy link
Member

nohwnd commented Mar 1, 2024

Thanks, that is good point, added to the known issues.

@nohwnd
Copy link
Member

nohwnd commented Mar 1, 2024

After short analysis I don't think this will be possible to do entirely from project. We need to set nodereuse, and env variables that tell msbuild if it should run with legacy settings and disable terminal logger, and so setting it in project is too late. But I will discuss with the team.

@KalleOlaviNiemitalo
Copy link

Can <Project TreatAsLocalProperty="VSTestUseMSBuildOutput"> help with the opt-out?

@nohwnd
Copy link
Member

nohwnd commented Mar 4, 2024

Thanks. This would help override the value in the project, but would not disable the new experience entirely. In hind-sight the overall switch should not have been a property. It is giving off the wrong semantics, I think. We are doing global setup long before msbuild parses the properties, and so overriding the property can disable one aspect of the run, but it won't re-enable nodereuse:false, and it won't set the environment variable that msbuild uses to disable terminal logger and all the connected machinery.

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

3 participants