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

./build.sh --test fails to find 'xunit.console.dll' #97470

Closed
tmds opened this issue Jan 24, 2024 · 9 comments · Fixed by dotnet/arcade#14413
Closed

./build.sh --test fails to find 'xunit.console.dll' #97470

tmds opened this issue Jan 24, 2024 · 9 comments · Fixed by dotnet/arcade#14413

Comments

@tmds
Copy link
Member

tmds commented Jan 24, 2024

I'm working on making our internal CI build .NET 9 (that is: main) branches.

Our runtime jobs fail while executing tests with this message (for each test project):

 The application to execute does not exist: 'xunit.console.dll'

I think this stopped working since 8726d6b. Maybe it has to do with the changes to xunit.props in that commit.

In our builds, we're building the clr+libs+host+packs+libs.tests subsets.
And we're running tests using ./build.sh --subset libs.tests --test.

@ViktorHofer do you have some thoughts on what is the cause, and how it can be fixed?

@ericstj I saw your PR here: #97454 and thought it might be related. I gave your branch to our CI, but unfortunately it did not solve the issue.

cc @omajid

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 24, 2024
@ghost
Copy link

ghost commented Jan 24, 2024

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

I'm working on making our internal CI build .NET 9 (that is: main) branches.

Our runtime jobs fail while executing tests with this message:

 The application to execute does not exist: 'xunit.console.dll'

I think this stopped working since 8726d6b. Maybe it has to do with the changes to xunit.props in that commit.

In our builds, we're building the clr+libs+host+packs+libs.tests subsets.
And we're running tests using ./build.sh --subset libs.tests --test.

@ViktorHofer do you have some thoughts on what is the cause, and how it can be fixed?

@ericstj I saw your PR here: #97454 and thought it might be related. I ran gave your branch to our CI, but unfortunately it did not solve the issue.

cc @omajid

Author: tmds
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@hoyosjs
Copy link
Member

hoyosjs commented Jan 24, 2024

@ViktorHofer was removing the unit packref intentional?

@ericstj
Copy link
Member

ericstj commented Jan 24, 2024

I'd say this is definitely caused by #96826 which my PR is reverting. In that PR we intentionally try to avoid copying Xunit.Console to the output unless we're sending tests to helix. Copying to the output was interfering with test discovery by dotnet test. We found later that multiple parts of the build are expecting xunit.console to be in the output and those need to be cleaned up.

It's possible that the arcade update PR is also causing this, but I don't see how.

@ViktorHofer
Copy link
Member

@ViktorHofer was removing the unit packref intentional?

Yes. We don't reference the meta package anymore as we need to control the xunit analyzer version separately. Arcade has been doing this for a while now: https://github.com/dotnet/arcade/blob/72f32d7d6880a97b457553ff601c383aaf69c902/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnit/XUnit.targets#L9-L13

@hoyosjs
Copy link
Member

hoyosjs commented Jan 25, 2024

Yes, but then the runner targets bring in xunit.runner.console

@tmds
Copy link
Member Author

tmds commented Jan 25, 2024

I'd say this is definitely caused by #96826 which my PR is reverting.

This was also my first suspect, but after doing some builds I suspect the Arcade PR instead.

It's possible that the arcade update PR is also causing this, but I don't see how.

The Arcade PR went in before your PR, and this what is in my build log for it:

...
++ git rev-parse HEAD
https://github.com/dotnet/runtime is at 8726d6b940bb0cfecbcade46159a1634137d7c18
...
  The application to execute does not exist: 'xunit.console.dll'
...
  The application to execute does not exist: 'xunit.console.dll'
...

@ViktorHofer
Copy link
Member

@tmds do you have a binlog that I could look at?

@tmds
Copy link
Member Author

tmds commented Jan 25, 2024

I tried to reproduce the issue on my machine, and found out it only happens when DotNetBuildFromSource is set to true.

I use the following command to reproduce it:

./build.sh --subset libs.tests+clr+libs+host --test /p:NoPgoOptimize=true /p:DotNetBuildFromSource=true --portablebuild false -rc Release -bl

do you have a binlog that I could look at?

I'll send you two via mail (one with and one without DotNetBuildFromSource) built from 8726d6b.

ViktorHofer added a commit to dotnet/arcade that referenced this issue Jan 25, 2024
This will fix dotnet/runtime#97470

While looking at Tom's binlog I noticed that the ExcludeFrom* infrastructure kicks in when building test projects in runtime.

This wasn't the case before c0c425d as the `IsTestProject` property was read before it got defined in runtime. My commit fixed that... but unintentionally broke Tom's scenario (building tests although DotNetBuildFromSource is true).

I asked Tom to add `DotNetBuildSkipTests=false` to their pipeline so that they can continue to build and run tests under source-build.

To make this work, the legacy switches need to respect `DotNetBuildSkipTests` otherwise they would have to wait weeks or months. Also, I don't see any reason why the legacy switches can't respect that setting.
@ViktorHofer
Copy link
Member

ViktorHofer commented Jan 25, 2024

Tom and I synced offline and we found the reason. I submitted dotnet/arcade#14413 to fix this. See my detailed commit message in there.

Additionally I submitted dotnet/arcade#14414 to make it possible to disable the entire ExcludeFromBuild Arcade infrastructure as in runtime we use a different (better) mechanism to filter out projects. After this PR is in, we want to set DisableArcadeExcludeFromBuildSupport=true in our Versions.props file.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants