8000 Add tests for test templates by mariam-abdulla · Pull Request #49102 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 4 commits into from
May 23, 2025

Conversation

mariam-abdulla
Copy link
Member
@mariam-abdulla mariam-abdulla commented May 22, 2025

This pull request introduces a new test suite for validating .NET project and item templates in the test/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:

Utility Enhancements:

  • Helper Methods:
    • AddItemToFsproj: Handles adding F# items to `.fsproj

@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 08:19
@mariam-abdulla mariam-abdulla requested a review from a team as a code owner May 22, 2025 08:19
Copy link
Contributor
@Copilot Copilot AI left a 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);

@mariam-abdulla mariam-abdulla enabled auto-merge (squash) May 22, 2025 14:27
];

private static readonly (string ProjectTemplateName, string ItemTemplateName, string[] Languages, bool SupportsTestingPlatform)[] AvailableItemTemplates =
[
Copy link
Member

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?

Copy link
Member

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?

@mariam-abdulla mariam-abdulla merged commit d9960a9 into main May 23, 2025
30 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/create-tests-for-test-templates branch May 23, 2025 21:40
@mariam-abdulla
Copy link
Member Author
mariam-abdulla commented May 26, 2025

Thank you, @marcpopMSFT.
I will address those comments in another PR.

#49145

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.

4 participants
0