Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix arcade property for Microsoft.VisualStudio.Razor.IntegrationTests.csproj #10661

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

Evangelink
Copy link
Member

Summary of the changes

Uses UseVSTestRunner instead of TestRunneName.

Fixes #10660

…Test

Uses `UseVSTestRunner` instead of `TestRunneName`.

Fixes dotnet#10660
@Evangelink Evangelink requested a review from a team as a code owner July 22, 2024 19:27
@davidwengier
Copy link
Member

Our integration tests are weird, and are 100% definitely written using xunit and so we need to use the xunit runner.

Is the current set up causing issues somewhere? Or is this just an oddity you noticed? Because if so, I suspect the real answer is that you're right, it is odd, but it also works :)

@Evangelink
Copy link
Member Author

Is the current set up causing issues somewhere?

Not at all! I am the owner of MSTest and was doing some lookup with @ViktorHofer of the repos onboarded to arcade and using MSTest and you were one of them. I was happily surprised so wanted to see how you were using MSTest and realized you don't and you probably only mixed up MSTest and VSTest :D

@Evangelink
Copy link
Member Author

Our integration tests are weird,

Yeah something is strange! You are relying on VSTest runner but you also add xunit.runner.console (which you would have automatically without using <UseVSTestRunner>). It's not clear if you have some conditions and you are sometimes running tests through dotnet test and sometimes through xunit.runner.console or if that's just some cleanup missing.

@@ -14,7 +14,7 @@
using Microsoft.Internal.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Settings;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were using 2 assertions from MSTest but all the rest of the project is using xUnit so I have changed these 2 assertions to use xUnit.

@@ -39,19 +39,8 @@
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" />
<PackageReference Include="NuGet.VisualStudio" />
<PackageReference Include="Microsoft.Internal.VisualStudio.Shell.Framework" />
<PackageReference Include="xunit" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a metapackage and all its transitive deps are already brought up by arcade so that's now useless.

<PackageReference Include="xunit.runner.console" Version="$(XUnitRunnerConsoleVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already brought by arcade

the Arcade XUnit.targets file, but finding that file is a pain, so instead we can just manually
import the package ourselves, but as an implicit definition to stop Nuget complaining.
TL;DR: MSBuild was designed to cause pain.
-->
<PackageReference Include="xunit.runner.console" Version="$(XUnitRunnerConsoleVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is strange. Either you want to run tests from VSTest/dotnet test (which seems to be the case given comment on line 8) or through xunit runner (in which case it's brought by arcade if you don't specify UseVSTestRunner).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The Arcade Sdk already brings this in.

@davidwengier
Copy link
Member

Thanks for the updates, at least it compiles now :)

I'm going to kick off an integration test run and if that passes, I'm happy to merge. In the past this area has proven very fragile though, so please forgive my caution.

@Evangelink
Copy link
Member Author

so please forgive my caution.

I know what it's like to have fragile testing infra so no worries at all! I honestly prefer that you take some time and don't call me back for an issue after that xD

@davidwengier
Copy link
Member

92 tests ran, and passed, so that's good enough for me. Thanks!

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

Successfully merging this pull request may close these issues.

Microsoft.VisualStudio.Razor.IntegrationTests.csproj uses wrongly MSTest runner
4 participants