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

Add test for source-built bundled NativeAOT. #113

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

tmds
Copy link
Member

@tmds tmds commented Sep 24, 2024

if (Commands.HasFlag(DotNetSdkActions.PublishAot))
{
// Non-portable bundled AOT Compiler.
if (isNonPortable && !dotNetHelper.IsMonoRuntime)
Copy link
Member

Choose a reason for hiding this comment

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

Ideally, this would be skipped at the test level with SkippableFact. This should be possible because, at a minimum, the SDK root location is known via environment variable. If that approach doesn't work out, it'd be good to at least write something to the output, via DotNetHelper.OutputHelper, that this is being skipped and the reason why.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally, this would be skipped at the test level with SkippableFact.

The project has no reference to a library that provides SkippableFact. What implementation should be used? Should it be a project reference, or do we want to include the sources into the project?

(isNonPortable && !dotNetHelper.IsMonoRuntime)

Currently, this check is made when the test class was instantiated.

To work nicely with SkippableFact we probably want to have a static check and for that ScenarioTestFixture would be refactored into a static class.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, it looks like there's already an existing pattern for skipping tests in this repo. It uses the Trait attribute. For example, it skips tests based on platform with this:

filters.ExcludedTraits.Add("SkipIfPlatform", new List<string>() {$"{platform}"});
(example usage of trait)

It'd be good if that pattern could be used here.

Copy link
Member Author

@tmds tmds Sep 25, 2024

Choose a reason for hiding this comment

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

ok, I'll follow that pattern. The trait would be something like: "BundledAotCompiler"?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I hadn't used XunitFilters before. From looking at it closer, the IncludedTraits requires all tests to have that trait, so I instead of an included trait ("BundledAotCompiler"), I've implemented it using excluded traits (!"Portable", !"Mono").

@mthalman ptal.

@mthalman mthalman merged commit b7ce675 into dotnet:main Sep 26, 2024
10 checks passed
tmds added a commit to tmds/scenario-tests that referenced this pull request Oct 11, 2024
mthalman pushed a commit that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants