Skip to content

[17.0] Fix SDK response-file regression test isolation and test-selection routing #22366

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues.

Describe the bug

Track two confirmed test-infrastructure findings from the direct merge of release/13.6 into release/17.0 in #22365. These are follow-up test fixes, not additional product security findings.

Servicing follow-up: intentionally non-blocking for #22365. Keep that PR a direct branch merge; address both items separately in 17.0 servicing rather than modifying release/13.6 for the merge.

  1. Release-build repository detection breaks the response-file tests. In tests/Aspire.Cli.Tests/Commands/Sdk/SdkResponseFileTests.cs, SdkCommands_IgnoreAutomaticResponseFiles calls AspireRepositoryDetector.DetectRepositoryRoot(AppContext.BaseDirectory) and asserts a non-null result. In Release builds, the detector only honors ASPIRE_REPO_ROOT; without it, all eight theory cases fail before testing response-file isolation. The real AppHostServerProjectFactory also requires repository detection to select DotNetBasedAppHostServerProject; passing a restore configuration directory does not enable repository mode. Find the checkout independently and run each scenario in an isolated child process with ASPIRE_REPO_ROOT set, following SdkDumpCi_ForHostingProject_DoesNotEmitWarnings. Avoid process-wide environment mutation in the parallel test host.

  2. TypeScript generator changes do not select the new regression suite. The generate cases dynamically build and load Aspire.Hosting.CodeGeneration.TypeScript. That runtime dependency is absent from the static test-project reference graph, and eng/github-ci/test-trigger-map.yml has no route from those generator inputs to test:Aspire.Cli.Tests. Add a test-consumer path_rules entry for the generator inputs and focused selector regression coverage.

Expected Behavior

  • All eight response-file scenarios exercise the intended behavior in both Debug and Release without requiring an ambient ASPIRE_REPO_ROOT or contaminating other tests.
  • TypeScript generator input changes select Aspire.Cli.Tests through the production selector, in addition to existing consumers.

Steps To Reproduce

Findings were confirmed by source inspection at PR head 2150dde35623f6754e98af77ca930d1c8fecb313; no local reproduction run was performed.

  1. Build/run SdkCommands_IgnoreAutomaticResponseFiles in Release with ASPIRE_REPO_ROOT unset. The initial repository-root assertion fails before response-file isolation is exercised.
  2. Trace selection for a source change under src/Aspire.Hosting.CodeGeneration.TypeScript/: the current static references and curated routing do not select test:Aspire.Cli.Tests for the runtime dependency.

Exceptions (if any)

Expected failure from source inspection: Assert.NotNull(repoRoot) in the Release-build scenarios. No captured exception or stack trace.

Aspire doctor output

N/A — test infrastructure and selective CI routing.

Anything else?

Acceptance: fix isolated-process setup, validate the targeted SDK scenarios in Debug and Release with the parent environment variable unset, and add/validate focused production-selector coverage for the runtime generator dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions