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

[wasm] Stop hardcoding TFM in Wasm.Build.Tests #112955

Merged
merged 9 commits into from
Mar 3, 2025
Merged

Conversation

kasperk81
Copy link
Contributor

#79219 follow up

@akoeplinger
Copy link
Member

looks like there are a few compiler errors.

now that I think about it some more I'm also not sure anymore whether this will work when we're between major versions since we might bump Environment.Version before we actually have an sdk that can target that TFM

@kasperk81
Copy link
Contributor Author

looks like there are a few compiler errors.

were you looking at the error in first commit? it's fixed in second

now that I think about it some more I'm also not sure anymore whether this will work when we're between major versions since we might bump Environment.Version before we actually have an sdk that can target that TFM

doesn't that apply to #79219? haven't heard of any problem in major updates

@akoeplinger
Copy link
Member

were you looking at the error in first commit? it's fixed in second

yeah you pushed just when I hit send on my comment :D

doesn't that apply to #79219? haven't heard of any problem in major updates

seems so from a quick glance. we can certainly try it

@kasperk81
Copy link
Contributor Author

one test timed out

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

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

What is the motivation for always passing the TFM instead of leaving it as optional parameter?

@kasperk81
Copy link
Contributor Author

What is the motivation for always passing the TFM instead of leaving it as optional parameter?

to make it compile. static readonly can't be used as default parameter and can't use Version.Major in const.

@maraf
Copy link
Member

maraf commented Feb 28, 2025

to make it compile. static readonly can't be used as default parameter and can't use Version.Major in const.

That's fair. Although I would prefer to use null as default and set it to DefaultTFM instead of having to pass the DefaultTFM everywhere.

@kasperk81 kasperk81 force-pushed the main branch 2 times, most recently from 38e0d8a to a5cd608 Compare February 28, 2025 12:09
@kasperk81
Copy link
Contributor Author

changed to null defaults

Copy link
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

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

looks great, left a couple comments

@@ -108,7 +108,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(Configuration con
public static IEnumerable<object?[]> BrowserBuildAndRunTestData()
{
yield return new object?[] { "", BuildTestBase.DefaultTargetFramework, DefaultRuntimeAssetsRelativePath };
yield return new object?[] { "-f net10.0", "net10.0", DefaultRuntimeAssetsRelativePath };
yield return new object?[] { $"-f {DefaultTargetFramework}", DefaultTargetFramework, DefaultRuntimeAssetsRelativePath };

if (EnvironmentVariables.WorkloadsTestPreviousVersions)
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little bit worried that we'll forget updating the earlier versions here.
Should we introduce a int MinimumTargetFramwork = 8 in BuildTestBase.cs and then here return all TFMs from MinimumTargetFramwork => DefaultTargetFramework?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are two old versions at max and in other places net7 and net6 were used. i've removed them and added Previous2 property. when it's time for net 11, it will be testing one STS version which may not be ideal in second half of the year (when it goes out of support) but won't break anything if nuget.config keeps dotnet9 for a while.

@akoeplinger akoeplinger changed the title using major version in tfm [wasm] Stop hardcoding TFM in Wasm.Build.Tests Mar 3, 2025
@akoeplinger akoeplinger merged commit c40c261 into dotnet:main Mar 3, 2025
29 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Build-mono community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants