-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add tests for test templates #49102
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 tests for test templates #49102
Conversation
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.
Pull Request Overview
Adds a new integration test for handling incorrect host data in template installations.
- Introduces an additional test case to verify installation exit code when host data is incorrect.
- Uses a custom hive and working directory for isolation in the new test.
Comments suppressed due to low confidence (2)
test/dotnet-new.IntegrationTests/DotnetNewInstallTests.cs:608
- The test method name ends with '1', which is ambiguous. Consider renaming it to reflect the specific scenario being tested, e.g.,
CanInstall_WhenHostDataIsIncorrect
.
public void CanShowWarning_WhenHostDataIsIncorrect1()
test/dotnet-new.IntegrationTests/DotnetNewInstallTests.cs:615
- This assertion only checks the exit code. To fully validate the behavior for incorrect host data, add assertions for expected warning messages in stdout or stderr.
.Should().ExitWith(0);
]; | ||
|
||
private static readonly (string ProjectTemplateName, string ItemTemplateName, string[] Languages, bool SupportsTestingPlatform)[] AvailableItemTemplates = | ||
[ |
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.
How will you make sure you add any new ones here that get added in the future? Is this going to be documented somewhere?
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.
From discussions with PMs, there is no support to add support for any other test framework nor any strong push on the support of non-MSTest ones. NUnit and xUnit are already barely maintained (we just bump version with exclusion to major version).
Still, we are happy to add some doc about these tests. Do you have any docs related to templates we could use?
Thank you, @marcpopMSFT. |
This pull request introduces a new test suite for validating
.NET
project and item templates in thetest/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.cs
file. The changes include adding comprehensive tests for template installation, compatibility across languages, and integration with testing platforms.Additions to Template Testing:
DotnetNewTestTemplatesTests
to test.NET
project and item templates, including their installation and test execution.SupportedTargetFrameworks
,AvailableItemTemplates
, andAvailableProjectTemplates
for defining supported frameworks and templates.ItemTemplate_CanBeInstalledAndTestArePassing
: Verifies that item templates can be installed and pass tests for various languages and frameworks.ProjectTemplate_CanBeInstalledAndTestsArePassing
: Validates project templates' installation and test execution.MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_CanBeInstalledAndTestsArePassing
: Tests integration of project templates with coverage tools and test runners.Utility Enhancements:
AddItemToFsproj
: Handles adding F# items to `.fsproj