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

VSTestLogger msbuild property is not respected #440

Open
olstakh opened this issue Feb 7, 2025 · 4 comments
Open

VSTestLogger msbuild property is not respected #440

olstakh opened this issue Feb 7, 2025 · 4 comments
Labels

Comments

@olstakh
Copy link

olstakh commented Feb 7, 2025

Silly question (for the life of me, couldn't find definitive answer reading through other issues).

Setting <VSTestLogger> property in csproj file only has effect with dotnet test, not by running tests in visual studio.
Placing corresponding LoggerRunSettings into .runsettings file applies to both cases.

Is there a way to supply a logger via some msbuild property, that is respected when running tests in VS?
Sometimes when test fails while running in VS - i see Open log file link that takes me to the failure - looking for this ability to provide custom path/logger

Using xunit 2.9.0 and xunit.runner.visualstudio 3.0.1.

@filzrev
Copy link

filzrev commented Feb 7, 2025

How about using dedicated .runsetting for Visual Studio environment by using BuildingInsideVisualStudio MSBuild property?

  <PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
    <RunSettingsFilePath>$(MSBuildProjectDirectory)\VisualStudio.runsettings</RunSettingsFilePath>
  </PropertyGroup>

Note:
When using xUnit.v3 package.
It need to specify following settings to disable MTP and use VSTest.
<DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability>

@bradwilson
Copy link
Member

We don't do anything with this setting (I've never even heard of it), so my guess is this is probably a question for the VSTest team rather than us.

@olstakh
Copy link
Author

olstakh commented Feb 7, 2025

Good idea, @filzrev , i'll give it a go.
@bradwilson , got it. so is it fair to say there's no way to customize logger for visualstudio.xunit (apart from runsettings)?

P. S. VSTestLogger seems to fairly used (according to my github code search), and since this package is a vstest adapter for xunit, i was assuming it'll be supported. Clearly the wrong assumption, thanks for clarifying

@bradwilson
Copy link
Member

I don't believe it has ever been our responsibility to read and respect that value. The logger in VSTest has nothing to do with us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants