Repository navigation
Replace TestTempDirectory with TemporaryWorkspace and clean up test project configuration - #18683
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18683Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18683" |
ee2df9d to
57e39ca
Compare
57e39ca to
423eb30
Compare
423eb30 to
2455e86
Compare
This comment has been minimized.
This comment has been minimized.
2455e86 to
6329288
Compare
6329288 to
bcc62fd
Compare
This comment has been minimized.
This comment has been minimized.
bcc62fd to
7825ad2
Compare
7825ad2 to
710ed55
Compare
710ed55 to
363e9c6
Compare
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Split workspace creation into two methods: - Create(): clean workspace without .aspire/settings.json (for non-CLI tests like Docker/Kubernetes that use VerifyDirectory on workspace.Path) - CreateForCli(): workspace with .aspire/settings.json sentinel so ConfigurationHelper.GetConfigRootDirectory resolves correctly Update all CLI test files to use CreateForCli.
This comment has been minimized.
This comment has been minimized.
…ssumptions - InitializeWorkspacesParent: delete stale aspire.config.json left by previous runs and create a backstop .aspire/settings.json so walks never escape to the user's home directory - SetConfigurationAsync_CreatesNewFile_WhenNoneExists: stop deleting the sentinel; assert on the legacy settings file that FindNearestSettingsFile actually writes to - ConfigSetCommand_LocalAppHostPath_RemainsAllowed: stop deleting the sentinel; EnsureAspireConfigFileForAppHostPathSettings migrates the legacy file to aspire.config.json correctly when the sentinel exists
This comment has been minimized.
This comment has been minimized.
…gsAsync When aspire.config.json or .aspire/settings.json exists at a directory level, that directory IS the workspace root. Stop walking up regardless of whether an appHost path is specified — absence of the path means no AppHost is configured, not 'keep searching parent directories.' Previously the walk continued past these files when they had no appHost path, allowing stale config from unrelated parent directories to contaminate the result. Also remove file creation/deletion from InitializeWorkspacesParent — the parent directory should not be mutated.
This comment has been minimized.
This comment has been minimized.
…ehavior Verify that the config walk stops at the workspace root (either aspire.config.json or .aspire/settings.json) even when the config has no appHost.path. Previously the walk continued to parent dirs and could pick up stale config.
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. Runs the full test matrix + all jobs (ALL) — a rule matching 'Aspire.slnx' selects ALL Selection computed for commit |
|
✅ No documentation update needed. docs_optional → internal_refactor No signals triggered (signal_count = 0). The PR replaces the |
…elper main renamed tests/Shared/TemporaryRepo.cs to TemporaryWorkspace.cs and moved its namespace from Aspire.Cli.Tests.Utils to Aspire.Tests.Utils (#18683). This branch predated that change, so merging main produced a clean textual merge but a broken build: the project referenced a deleted file and a deleted namespace. Without this adaptation the merged tree fails with: - CS2001: source file TemporaryRepo.cs could not be found - CS0246: namespace Aspire.Cli.Tests.Utils does not exist git reported no conflict (the two csproj edits were in different regions), so the break would have been silent on merge. Fix: - Point the shared compile include at TemporaryWorkspace.cs. - Update the using directive to Aspire.Tests.Utils. Verified: Aspire.Hosting.RemoteHost.Tests builds with 0 warnings/0 errors and PromptInputs_ResultCarriesSubmittedFileMetadataByName passes. Co-authored-by: Copilot App <[email protected]>
Description
Replace the minimal
TestTempDirectoryhelper with a robustTemporaryWorkspaceclass and clean up test project configuration:TestTempDirectorywithTemporaryWorkspace— the new shared utility creates a workspace directory with retry-based cleanup,.aspire/settings.jsonsentinel (stops config directory walks), git init support, and workspace preservation for debugging failed tests.Workspace/{random-filename}instead of long GUIDs) to stay within the ~108-byte Unix Domain Socket path limit.tests/Shared/TempDirectory.cs— superseded byTemporaryWorkspace.using Aspire.Cli.Tests.Utilsfrom 72 test source files — this namespace does not exist and was causing CS0234 build errors.<Using Include="Aspire.Tests.Utils" />to test projects that useTemporaryWorkspace.Aspire.slnxand several test.csprojfiles.Checklist