-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Reenable TemplateEngine tests #42267
Conversation
looks like there is already a fixed version test: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.Tests/DotnetNewDetailsTest.Approval.cs#L47 |
Yeah, the test is supposed to test not passing a version but I think that won't really work with a package that is frequently updated. In other tests we use |
...sts/Approvals/DotnetNewDetailsTest.CanDisplayDetails_InstalledPackage_OtherFeed.verified.txt
Outdated
Show resolved
Hide resolved
Package version: 4.0.3038 | ||
Details: Collection of templates for Azure Functions | ||
NUnit3.DotNetNew.Template | ||
Package version: 1.9.0 |
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.
Is there any way to change the test comparison logic to not actually check the details and package version? If we don't control the template, those could change at any time and break the test (even if we do control it, it might need to change). Having a test gate on a dynamic set of values like that is not great.
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.
I noticed that almost all the test failures are due to version issues, so we can simply check if it is the latest version.
throw new Exception("No versions found."); | ||
} | ||
|
||
return versions.Last(); |
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.
FYI the last entry is not necessarily the latest stable version, e.g. when we have previews, but looks like we don't need to care about that since templates don't support preview versions: dotnet/templating#1423
fixes: #42260