-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Build & run tests for test templates via a pipeline to support CG #49147
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
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
This PR introduces automated execution of test-template integration tests by extending the SDK build pipeline.
- Adds a new pipeline step to invoke a PowerShell script for test-template tests
- Provides
RunTestTemplateTests.ps1
to run the dotnet-new integration tests in the dogfood environment
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
eng/pipelines/templates/jobs/sdk-build.yml | Inserts a powershell step to run RunTestTemplateTests.ps1 |
build/RunTestTemplateTests.ps1 | Adds a script that locates and runs the dotnet-new integration tests |
Comments suppressed due to low confidence (2)
build/RunTestTemplateTests.ps1:15
- [nitpick] Consider renaming
$classNameFilter
to something like$filterOption
or$filterArg
to better reflect that it's thedotnet test
filter flag, not specifically a class-name filter.
$classNameFilter = "--filter"
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dotnet/sdk into dev/mabdullah/test-templates-cg
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.
LGTM. I am wondering if there is some preference on SDK repo to start using cs files now that we can do dotnet run <file>.cs
@@ -4,7 +4,6 @@ VisualStudioVersion = 17.1.31903.286 | |||
MinimumVisualStudioVersion = 10.0.40219.1 | |||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{50A89C27-BA35-44B2-AC57-E54551791C64}" | |||
ProjectSection(SolutionItems) = preProject | |||
eng\cgmanifest.json = eng\cgmanifest.json |
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.
Was it requested to drop the manifest?
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.
Building and running those test projects is the other way to report our used packages to CG.
$ErrorActionPreference = 'Stop' | ||
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..') | ||
$classNameFilter = "--filter" | ||
$filterValue = "FullyQualifiedName~Microsoft.DotNet.Cli.New.IntegrationTests.DotnetNewTestTemplatesTests" |
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.
Mixing tabs and spaces
This pull request introduces a new PowerShell script to run test template tests in the dogfood environment and integrates it into the SDK build pipeline. The key changes include the addition of the script and its execution step in the pipeline configuration.
Additions to test execution:
build/RunTestTemplateTests.ps1
: Added a new PowerShell script to run theMicrosoft.TestTemplates.Acceptance.Tests.dll
in the dogfood environment. The script includes functionality to locate the test DLL, verify its existence, and execute it using thedogfood.ps1
script. It also handles error reporting and exit codes.Pipeline integration:
eng/pipelines/templates/jobs/sdk-build.yml
: Integrated the newRunTestTemplateTests.ps1
script into the SDK build pipeline by adding a PowerShell step to execute the script. This step is labeled "🟣 Run Test Templates Tests" in the pipeline.