Skip to content

Add Aspire integration tests that build after scaffolding and enable them - #3806

Open
haileymck wants to merge 1 commit into
mainfrom
dev/hmckelvie/aspire-build-tests
Open

Add Aspire integration tests that build after scaffolding and enable them#3806
haileymck wants to merge 1 commit into
mainfrom
dev/hmckelvie/aspire-build-tests

Conversation

@haileymck

Copy link
Copy Markdown
Member

Summary

Adds end-to-end Aspire integration tests that scaffold caching, database, and storage integrations and then build the resulting project, verifying the scaffolded output actually compiles. Also enables the previously-skipped Aspire integration tests across net8.0/net9.0/net10.0/net11.0.

All 125 Aspire integration tests pass across all four TFMs (Caching 28, Database 28, Storage 69).

What changed

Tests

  • AspireCachingIntegrationTestsBase.cs, AspireDatabaseIntegrationTestsBase.cs, AspireStorageIntegrationTestsBase.cs: replaced placeholder templates with buildable AppHost + worker projects, added *_ScaffoldsAndBuilds E2E facts that scaffold the integration and then run a real build, and removed the Skip attributes so the suite runs.
  • Helpers/ScaffoldCliHelper.cs: added Aspire template/project helpers; WriteAspireNuGetConfig now lets net8 Aspire fall through to the machine/repo dnceng feeds (like net9/10/11). Aspire packages are unpinned (IsVersionRequired=false) and need a live latest-version lookup, which nuget.org-only config can't serve; dnceng dotnet-public mirrors nuget.org and is CI-valid.

Product fixes uncovered by the tests

  • dotnet-scaffold.csproj: corrected Aspire code-mod config layout so the config files are located at runtime.
  • AspireCodeModificationHelper.cs: fixed Aspire config-path resolution.
  • IScaffoldRunner.cs / ScaffoldRunner.cs / Program.cs: propagate the scaffold exit code (RunAsync now returns Task<int>) so failures surface as a non-zero CLI exit code.

Related issues

Umbrella:

Per-integration / per-TFM:

Testing

  • Caching: 28/28 pass (net8/9/10/11)
  • Database: 28/28 pass (net8/9/10/11)
  • Storage: 69/69 pass (net8/9/10/11)

…them

Adds end-to-end Aspire integration tests that scaffold caching, database, and
storage integrations and then build the resulting project, and enables the
previously skipped Aspire integration tests across net8/9/10/11.

Also fixes three underlying product bugs uncovered by the tests:
- Aspire code-mod config layout in dotnet-scaffold.csproj
- Aspire config-path resolution in AspireCodeModificationHelper
- CLI exit-code propagation (IScaffoldRunner.RunAsync now returns Task<int>)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment