Skip to content

Add test for PublishSingleFile+PublishAot #34948

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

agocke
Copy link
Member

@agocke agocke commented Aug 25, 2023

No description provided.

@ghost ghost added Area-ILLink untriaged Request triage from a team member labels Aug 25, 2023
@agocke
Copy link
Member Author

agocke commented Aug 25, 2023

cc @dotnet/ilc-contrib

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thank you!

var rid = buildProperties["NETCoreSdkPortableRuntimeIdentifier"];
var publishCommand = new PublishCommand(testAsset);
publishCommand
.Execute($"/p:RuntimeIdentifier={rid}", "/p:SelfContained=true")
Copy link
Member

Choose a reason for hiding this comment

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

Is /p:RuntimeIdentifier={rid} and /p:SelfContained=true still needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good question. I think the warning has been removed, so this might be fine. I'll try it and see.

@agocke agocke enabled auto-merge (squash) August 30, 2023 23:04
.Execute().Should().Pass()
.And.HaveStdOutContaining("Hello World");
}

[RequiresMSBuildVersionTheory("17.8.0")]
[MemberData(nameof(Net7Plus), MemberType = typeof(PublishTestUtils))]
Copy link
Member

Choose a reason for hiding this comment

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

The new test should have this attribute as well - it can only run on .NET 7 +, right, or maybe even newer??

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a situation where we run the unit tests on different versions? I don't really understand how we would expect that to work.

Copy link
Member

Choose a reason for hiding this comment

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

Reason one - consistency - if the other test has it, then why is this one different?

Reason two - my understanding is that to maintain SDK back compat, we can run the unit tests against older TFMs to test for it - and thus tests which can only work on a given TFM need to be marked accordingly.

But I know next to nothing about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rainersigwald Could you shed some light on this? When should we be using RequiresMSBuildVersion? These tests are core-SDK only, so I don't think desktop MSBuild is even a consideration.

Copy link
Member

Choose a reason for hiding this comment

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

AFAIK RequiresMSBuildVersion means "when building using msbuild.exe this uses features that are new to the named version". Since msbuild.exe is delivered to the test runners through their VS install, it's generally not up to date with the version embedded in the SDK--but Microsoft-internal folks generally are, if they're running VS Internal Preview. So that gets some coverage + lights up coverage automatically after the VS on the image updates.

In general, if the PR tests pass I don't think you need the attribute

These tests are core-SDK only, so I don't think desktop MSBuild is even a consideration.

Really? Based on looking at the test I would have expected it to work driven by either build engine.

Copy link
Member Author

Choose a reason for hiding this comment

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

They probably work fine, I just don't particularly want to support desktop MSBuild if I don't have to. Reduces version swing.

@agocke agocke closed this Sep 5, 2023
auto-merge was automatically disabled September 5, 2023 21:16

Pull request was closed

@agocke agocke reopened this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ILLink untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants