-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add option for building a test exe as single file #42972
Conversation
32bf748
to
e4ce7b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This design will need to change as with #39923 the xunit.console targets and props files and the RunTests.cmd/sh generation for desktop configuration will go away. We should really get #39923 as that's part of our crash dump working group.
I'm marking this as request changes meanwhile to avoid an accidental merge.
/cc @akoeplinger |
src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj
Outdated
Show resolved
Hide resolved
@ViktorHofer Haven't seen that PR before, I'll try to integrate. I'd also like to treat this as progressive enhancement -- enable one project at at time. Idea on how best to do that? Is there a central list of the test projects which I could condition on |
We have been doing similar things for Wasm and iOS as we enable more projects and get them green: runtime/src/libraries/tests.proj Line 24 in a986fe1
Maybe we could do it in a cleaner way by adding these items to a testexclusion.props file or something and import it so that |
<Target Name="__ExcludeAssembliesFromSingleFile" | ||
Inputs="%(ResolvedFileToPublish.Identity)" | ||
Outputs="__NewResolvedFiles" | ||
BeforeTargets="_ComputeFilesToBundle"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually try to not depend on private targets which are implementation detail and could change their name or be removed. Is there a public target that runs before this or on the chain of this target that you can hook to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment, but I think we could probably add something. I'm open to adding a lot more integration points here to help with testing.
@safern @ViktorHofer Can you help me write the yaml for a new leg? I don't really know what these commands do. |
I can help. Feel free to ping me offline. |
@safern I think I'm really close to having this working -- I think the problem is that I'm depending on the singlefilehost produced by the |
I believe that wouldn't be such a hard change to do. @jkoritzinsky of @ViktorHofer do you know how we can change the order so that libs.tests is the last subset built when passed as part of the subsets? |
I believe it is just a matter of moving this: Lines 245 to 247 in e5c7168
to after the host subsets. @agocke do you need all the host subsets? I'm asking as it seems like it builds host.tests by default: https://github.com/dotnet/runtime/blob/master/eng/Subsets.props#L109-L113 |
I probably need |
@safern @ViktorHofer I believe this is ready for review |
The VS test work is helpful, but for now we'll have to always have a custom runner for platforms like single-file and mobile
@MichalStrehovsky I believe this is ready for integration if you wouldn't mind reviewing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs
Outdated
Show resolved
Hide resolved
…Runner.cs Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Not a pipeline expert, so I'm not reviewing the yml changes.
Hello @agocke! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
buildConfig: Release | ||
platforms: | ||
- windows_x64 | ||
- Linux_x64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be missing osx_x64
, is it by design?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some problems what I tested this earlier. Bringing Mac online would be good, but wasn't necessary for a first pass here.
This is a work-in-progress PR, I haven't yet figured out how the xharness runners actually report test failures, since it doesn't look like they write the xunit results anywhere.
There's also the simpler matter of the exes not actually passing the tests...