Replace template harness with CLI E2E coverage#16305
Replace template harness with CLI E2E coverage#16305
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16305Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16305" |
|
Re-running the failed jobs in the CI workflow for this pull request because 2 jobs were identified as retry-safe transient failures in the CI run attempt.
|
radical
left a comment
There was a problem hiding this comment.
Review: 5 findings (1 coverage gap high, 2 coverage gap medium, 1 flaky pattern medium, 1 correctness low). Inline comments on 4 findings above.
Additional finding (file-level):
The deleted EmptyAppHostTemplateTests.cs, JavaEmptyAppHostTemplateTests.cs, and TypeScriptEmptyAppHostTemplateTests.cs ran aspire new aspire-apphost → build → run as a happy-path smoke test. TemplateVariantSmokeTests covers JS/Python/TS starters, but the .NET aspire-apphost empty template’s build+run path has no replacement coverage. The only related test (NoHttpsTemplateRequiresAllowUnsecuredTransport) is a negative test with --no-https. Consider adding a happy-path smoke for the .NET empty apphost template.
|
We run some of the template tests in the internal build - aspire/eng/pipelines/templates/BuildAndTest.yml Lines 201 to 217 in 69e9ebe |
Why? |
526c5ca to
2d6757b
Compare
radical
left a comment
There was a problem hiding this comment.
Review feedback from walkthrough.
radical
left a comment
There was a problem hiding this comment.
Review comments for removing remaining Aspire.Templates.Tests/custom test SDK infrastructure and replacing the removed AzDO template coverage with direct CLI E2E coverage.
2d6757b to
c282caa
Compare
|
Re-running the failed jobs in the CI workflow for this pull request because 4 jobs were identified as retry-safe transient failures in the CI run attempt.
Matched test failure patterns (1 test)
|
0ee22b4 to
fb465e6
Compare
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
There was a problem hiding this comment.
Pull request overview
Replaces the dedicated Aspire.Templates.Tests harness with CLI E2E coverage, and rewires CI/Helix/docs to match the new testing model.
Changes:
- Deletes the standalone template test project plus its SDK-install and Helix plumbing.
- Adds new CLI E2E smoke/behavior tests for starter, AppHost, TypeScript, Java, Python, and .NET template scenarios.
- Updates GitHub Actions, AzDO, archive verification, and docs to use the new CLI-driven coverage path.
Findings:
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.csreturns the firstlocalhostURL from raw JSON text, which will usually bedashboardUrl, soStarterJsonContractsAndEndpointsRespondvalidates the dashboard instead of thewebfrontendendpoint.tests/Aspire.Cli.EndToEnd.Tests/StarterTemplateBehaviorTests.csdrops the old Redis starter frontend/cache assertions; the replacement only checks resource presence plus API output.tests/Aspire.Cli.EndToEnd.Tests/StarterTemplateBehaviorTests.csno longer covers special-character/unicode project names that the deleted harness used to validate template name sanitization and encoding behavior.tests/Aspire.Cli.EndToEnd.Tests/DotNetTemplateBehaviorTests.csremoves the old net8/net10 and unsupported-SDK/TFM matrix coverage, leaving no replacement regression coverage for template compatibility across supported TFMs.
Show a summary per file
| File | Description |
|---|---|
tests/workloads.proj |
Removed obsolete template-SDK installer wrapper. |
tests/Shared/TemplatesTesting/EnvironmentVariables.cs |
Removed old template SDK env var. |
tests/Shared/TemplatesTesting/BuildEnvironment.cs |
Simplified template test environment/bootstrap logic. |
tests/Shared/InstallSdk.targets |
Removed standalone SDK provisioning target. |
tests/Shared/InstallSdk.props |
Removed SDK install helper props. |
tests/Shared/Hex1bAutomatorTestHelpers.cs |
Tweaked agent prompt handling; added TS restore/typecheck helper. |
tests/Shared/Docker/Dockerfile.e2e-polyglot-java |
Hardened apt update invocation. |
tests/Shared/Docker/Dockerfile.e2e-polyglot-base |
Hardened apt update invocation. |
tests/Shared/Docker/Dockerfile.e2e-podman |
Hardened apt update invocation. |
tests/Shared/Docker/Dockerfile.e2e |
Hardened apt update invocation. |
tests/Shared/Aspire.Templates.Testing.targets |
Removed template-test MSBuild plumbing. |
tests/Shared/Aspire.Templates.Testing.props |
Removed template-test props import. |
tests/README.md |
Updated test infra/local-run documentation. |
tests/Infrastructure.Tests/WorkflowScripts/AutoRerunTransientCiFailuresTests.cs |
Updated workflow fixture expectations. |
tests/Infrastructure.Tests/Shared/TestDataBuilder.cs |
Removed requiresTestSdk metadata support. |
tests/Infrastructure.Tests/PowerShellScripts/BuildTestMatrixTests.cs |
Removed requiresTestSdk test case. |
tests/helix/send-to-helix-templatestests.targets |
Removed template-tests Helix category. |
tests/helix/send-to-helix-inner.proj |
Removed template-SDK payload/env handling. |
tests/helix/send-to-helix-endtoendtests.targets |
Dropped template-SDK dependency flag. |
tests/helix/send-to-helix-ci.proj |
Removed template-tests category from Helix dispatch. |
tests/helix/send-to-helix-buildonhelixtests.targets |
Removed template-SDK PATH injection. |
tests/helix/send-to-helix-basictests.targets |
Removed template-SDK dependency flag. |
tests/Directory.Build.targets |
Removed template testing targets import. |
tests/Directory.Build.props |
Removed template-test archive/props settings. |
tests/Aspire.Templates.Tests/xunit.runner.json |
Deleted old template test runner config. |
tests/Aspire.Templates.Tests/TestSdk.cs |
Deleted old template SDK enum. |
tests/Aspire.Templates.Tests/TemplateTestsBase.cs |
Deleted old template harness base. |
tests/Aspire.Templates.Tests/TemplateAppFixture.cs |
Deleted old template app fixture. |
tests/Aspire.Templates.Tests/StarterTemplateWithRedisCacheTests.cs |
Deleted old Redis starter run test. |
tests/Aspire.Templates.Tests/StarterTemplateWithRedisCacheTests_PreviousTFM.cs |
Deleted old previous-TFM Redis starter test. |
tests/Aspire.Templates.Tests/StarterTemplateWithRedisCacheFixture.cs |
Deleted old Redis starter fixture. |
tests/Aspire.Templates.Tests/StarterTemplateWithRedisCacheFixture_PreviousTFM.cs |
Deleted old previous-TFM Redis starter fixture. |
tests/Aspire.Templates.Tests/StarterTemplateRunTestsBase.cs |
Deleted old starter run assertions base. |
tests/Aspire.Templates.Tests/StarterTemplateRunTests.cs |
Deleted old starter run test. |
tests/Aspire.Templates.Tests/StarterTemplateRunTests_PreviousTFM.cs |
Deleted old previous-TFM starter run test. |
tests/Aspire.Templates.Tests/StarterTemplateProjectNamesTests.cs |
Deleted old project-name coverage. |
tests/Aspire.Templates.Tests/StarterTemplateFixture.cs |
Deleted old starter fixture. |
tests/Aspire.Templates.Tests/StarterTemplateFixture_PreviousTFM.cs |
Deleted old previous-TFM starter fixture. |
tests/Aspire.Templates.Tests/README.md |
Removed old template harness documentation. |
tests/Aspire.Templates.Tests/PerTestFrameworkTemplatesTests.cs |
Deleted old support-template tests. |
tests/Aspire.Templates.Tests/NewUpAndBuildSupportProjectTemplatesTests.cs |
Deleted old support-template SDK/TFM matrix tests. |
tests/Aspire.Templates.Tests/NewUpAndBuildStandaloneTemplateTests.cs |
Deleted old standalone template SDK/TFM matrix tests. |
tests/Aspire.Templates.Tests/LocalhostTldHostnameTests.cs |
Deleted old localhost TLD tests. |
tests/Aspire.Templates.Tests/EmptyTemplateRunTests.cs |
Deleted old empty-template run test. |
tests/Aspire.Templates.Tests/EmptyTemplateRunFixture.cs |
Deleted old empty-template fixture. |
tests/Aspire.Templates.Tests/Directory.Build.props |
Removed old template-project marker props. |
tests/Aspire.Templates.Tests/BuildAndRunTemplateTests.cs |
Deleted old build/run template tests. |
tests/Aspire.Templates.Tests/BuildAndRunStarterTemplateBuiltInTest.cs |
Deleted old built-in starter test coverage. |
tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj |
Deleted old template test project. |
tests/Aspire.Templates.Tests/AppHostTemplateTests.cs |
Deleted old AppHost template compatibility test. |
tests/Aspire.EndToEnd.Tests/IntegrationServicesFixture.cs |
Switched E2E fixture to default build environment. |
tests/Aspire.EndToEnd.Tests/Directory.Build.props |
Removed template-test-specific props. |
tests/Aspire.Cli.Tests/DotNet/ProcessExecutionTests.cs |
Relaxed Windows timeout for exit-wait test. |
tests/Aspire.Cli.EndToEnd.Tests/TypeScriptStarterTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/TypeScriptReusablePackageTests.cs |
Reused new TS restore/typecheck helper. |
tests/Aspire.Cli.EndToEnd.Tests/TypeScriptEmptyAppHostTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/TemplateVariantSmokeTests.cs |
Added consolidated non-default template smoke tests. |
tests/Aspire.Cli.EndToEnd.Tests/StarterTemplateBehaviorTests.cs |
Added starter/support-template behavior coverage. |
tests/Aspire.Cli.EndToEnd.Tests/SmokeTests.cs |
Expanded core smoke coverage and JSON contract checks. |
tests/Aspire.Cli.EndToEnd.Tests/PythonReactTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/JsReactTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/JavaEmptyAppHostTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs |
Added workspace/JSON assertion helpers. |
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs |
Added new subcommand/run/capture helpers; changed stop behavior. |
tests/Aspire.Cli.EndToEnd.Tests/EmptyAppHostTemplateTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/DotNetTemplateBehaviorTests.cs |
Added .NET template behavior regression coverage. |
tests/Aspire.Cli.EndToEnd.Tests/DescribeCommandTests.cs |
Switched to shared start/stop helpers. |
tests/Aspire.Cli.EndToEnd.Tests/BundleSmokeTests.cs |
Folded into consolidated smoke coverage. |
tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj |
Removed skip gate from CLI E2E project. |
src/Aspire.ProjectTemplates/README.md |
Pointed docs to CLI E2E coverage. |
playground/AspireWithMaui/AspireWithMaui.slnx |
Removed deleted template test project. |
eng/Versions.props |
Replaced template-test SDK version props with Helix runtime SDK prop. |
eng/testing/CITestsProperties.props |
Removed requiresTestSdk property registry entry. |
eng/TestEnumerationRunsheetBuilder/TestEnumerationRunsheetBuilder.targets |
Removed special template-test enumeration skip. |
eng/scripts/verify-cli-archive.ps1 |
Expanded archive verification to starter + hidden AppHost templates. |
eng/pipelines/templates/BuildAndTest.yml |
Replaced template harness runs with CLI E2E subset and archive staging. |
eng/pipelines/azure-pipelines.yml |
Passed Windows target RIDs into shared pipeline template. |
eng/pipelines/azure-pipelines-unofficial.yml |
Passed Windows target RIDs into shared pipeline template. |
dogfood.sh |
Switched dogfood SDK path to repo-local .dotnet. |
docs/ci/TestingOnCI.md |
Updated CI test-matrix docs for CLI E2E model. |
docs/ci/azdo-public-pipeline.md |
Updated AzDO/Helix docs after template harness removal. |
Aspire.slnx |
Removed deleted template test project. |
.github/workflows/tests.yml |
Always enumerates CLI E2E tests; updated skipped-job gating. |
.github/workflows/run-tests.yml |
Removed template SDK install step and old artifact path upload. |
.github/CODEOWNERS |
Removed ownership for deleted template-test paths. |
.github/actions/enumerate-tests/action.yml |
Updated enumerate-tests action docs/examples. |
Copilot's findings
- Files reviewed: 86/86 changed files
- Comments generated: 4
647b397 to
03aa12d
Compare
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
IEvangelist
left a comment
There was a problem hiding this comment.
Really nice cleanup — replacing the heavyweight template harness with focused CLI E2E coverage is a meaningful simplification and the new test structure reads much more cleanly. The signed-archive verification step is a great addition. Approving with one small finding worth considering; the rest of the substantial feedback already on the PR from @radical and @copilot covers the remaining points well.
The .NET Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
radical
left a comment
There was a problem hiding this comment.
Deep-review pass on top of the existing feedback. Skipping items already covered in the prior review threads (template framework matrix narrowing, hostname edge cases, CPM/SDK/version-override coverage gaps, parameters.targetRids plumbing, requiresTestSdk / workloads.proj / InstallSdk.* cleanup, CODEOWNERS dangling entry, webfrontend silent-skip).
A few additional items inline below. Two non-anchorable notes:
-
Stale
dotnet-testsprocess killer —.github/skills/fix-flaky-test/run-test-repeatedly.sh:135-136and.github/skills/fix-flaky-test/run-test-repeatedly.ps1:128-130still hunt fordotnet-testsprocesses. With the custom test SDK install fully removed by this PR, that's dead code now. Worth cleaning up here while we're touching the surrounding test infra. -
Namespace cleanup in
tests/Shared/TemplatesTesting/*— those shared helpers still use theAspire.Templates.Testsnamespace, even though the project of that name is gone. They are now consumed byAspire.EndToEnd.Tests,Aspire.Acquisition.Tests,Aspire.Dashboard.Tests, etc. Suggest renaming the namespace to something neutral likeAspire.Tests.TemplatesTestingso it reflects general-purpose helpers rather than a deleted project.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/0d859769-a001-44c7-b373-4e3f348e6614 Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrite Ubuntu archive and security apt sources to the Azure mirror before retrying installs in the shared CLI E2E Docker helper. This avoids repeated CI failures when archive.ubuntu.com and security.ubuntu.com are unreachable from GitHub-hosted runners, while allowing APT_RETRY_UBUNTU_MIRROR to override or disable the rewrite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fail loudly when the signed win-x64 CLI archive is missing, expand AzDO template coverage, and document the win-arm64 staging-only path. Harden Bun installer retries and wait for apiservice readiness before endpoint assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c7e0e24 to
e5eda56
Compare
|
🎬 CLI E2E Test Recordings — 82 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25360158323 |
Description
This removes the standalone
tests/Aspire.Templates.Testsharness and moves the template coverage we still want to keep into Aspire CLI E2E tests.The old harness provided broad matrix coverage, but it was hard to debug, had dedicated CI/Helix plumbing, and duplicated scenarios that are better validated through the real CLI. This PR keeps high-signal behavioral coverage, makes failures easier to diagnose, and intentionally drops low-signal matrix breadth.
Test coverage changes
BuildAndRunTemplateTests.BuildAndRunAspireTemplateSmokeTests.CreateAndRunDotNetEmptyTemplateProject,SmokeTests.CreateAndRunDotNetAppHostTemplateProjectaspire new/aspire startCLI E2E coverage.BuildAndRunTemplateTests.BuildAndRunAspireTemplateWithCentralPackageManagementDotNetTemplateProjectFileBehaviorTests.DotNetTemplateWithCentralPackageManagementBuildsAndStartsBuildAndRunTemplateTests.BuildAndRunAspireTemplateWithExplicitSdkReferenceDotNetTemplateProjectFileBehaviorTests.DotNetTemplateWithExplicitSdkReferenceBuildsAndStartsBuildAndRunTemplateTests.CreateAndModifyAspireAppHostTemplateDotNetTemplateProjectFileBehaviorTests.DotNetAppHostTemplateBuildsWithAppHostPackageVersionOverrideBuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariableDotNetTemplateTransportTests.NoHttpsTemplateRequiresAllowUnsecuredTransportAppHostTemplateTests.EnsureProjectsReferencing8_1_0AppHostWithNewerWorkloadCanBuildDotNetTemplateProjectFileBehaviorTests.DotNetAppHostTemplateBuildsWithAppHostPackageVersionOverride("8.1.0")LocalhostTldHostnameTests.LocalhostTld_GeneratesDnsCompliantHostnamesDotNetTemplateLocalhostTldTests.LocalhostTldGeneratesDnsCompliantHostnamesaspire-apphost-singlefileDotNetSingleFileAppHostTemplateTests.SingleFileAppHostTemplateBuildsAndStartsBuildAndRunStarterTemplateBuiltInTest.BuildAndRunStarterTemplateBuiltInTest_TestStarterTemplateBehaviorTests.StarterTemplateCanGenerateAndRunBuiltInTestsStarterTemplateRunTestsBase.ResourcesShowUpOnDashboard,WebFrontendWorks,ApiServiceWorksSmokeTests.CreateAndRunDefaultAspireStarterProject,SmokeTests.StarterJsonContractsAndEndpointsRespondaspire start,aspire ps, andaspire describeJSON contract assertions plus HTTP 200 endpoint validation.StarterTemplateWithRedisCacheTestsand previous-TFM Redis variantsStarterTemplateBehaviorTests.StarterTemplateWithRedisHasCacheResourceAndApiRespondsNewUpAndBuildSupportProjectTemplatesTestsforaspire-xunit,aspire-nunit,aspire-mstestSupportProjectTemplateBehaviorTests.SupportProjectTemplatesRunAgainstGeneratedAppHostdotnet test, not only build.SupportProjectTemplateBehaviorTests.SupportProjectTemplatesRunAgainstGeneratedAppHostfor default xUnit and xUnit v3PerTestFrameworkTemplatesTestsand broad starter project-name matrixStarterTemplateBehaviorTestsandSupportProjectTemplateBehaviorTestsNewUpAndBuildStandaloneTemplateTestsbroadnew + buildmatrixSmokeTests,DotNetTemplateBehaviorTests, andTemplateVariantSmokeTestsSmokeTestsandTemplateVariantSmokeTestsTemplateVariantSmokeTests.CreateAndRunPythonReactProject,CreateAndRunTypeScriptEmptyAppHostProject,CreateAndRunTypeScriptStarterProjectnpm run buildbefore start.TemplateVariantSmokeTests.CreateAndRunJavaEmptyAppHostProject,CreateAndRunJsReactProjectTestSdkworkload/SDK matrixOther changes
tests/Aspire.Templates.Testsand its helper/fixture infrastructure.templatestestscategory.tests/README.mdto point at the CLI E2E replacement coverage.eng/scripts/verify-cli-archive.ps1.Debuggability improvements
The replacement tests use normal CLI E2E infrastructure:
[CaptureWorkspaceOnFailure]AspireStartAsync/AspireStopAsynchelpersValidation
./restore.shdotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --nologo --verbosity:minimaldocker build --target runtime --build-arg SKIP_SOURCE_BUILD=true -f tests/Shared/Docker/Dockerfile.e2e -t aspire-e2e-dockerfile-check .Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: