Repository navigation
Speed up CLI and dashboard tests - #22714
James Newton-King (JamesNK) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22714Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22714" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the test-only changes aimed at reducing unnecessary waits and redundant setup.
No open issues 🎉
What changed in this PR
Speeds up Aspire CLI and dashboard tests by removing deliberate waits and redundant setup without changing production code.
Changes:
- Simulates NuGet failures without HTTP retries, retaining local-feed search and credential-redaction assertions.
- Backdates cache entries and checks stream cancellation directly instead of waiting for expiry or timeouts.
- Batches 10,002 metric data points into two payloads while preserving merged attribute-value limit coverage.
| File | Description |
|---|---|
tests/Aspire.Dashboard.Tests/TelemetryRepositoryTests/MetricsTests.cs |
Batches metric points to reduce repeated instrument validation. |
tests/Aspire.Dashboard.Tests/TelemetryApiServiceTests.cs |
Replaces timeout waits with pending-stream and cancellation assertions. |
tests/Aspire.Cli.Tests/NuGet/NuGetClientTests.cs |
Injects immediate search failures and strengthens redacted-log assertions. |
tests/Aspire.Cli.Tests/Caching/DiskCacheTests.cs |
Backdates filenames and verifies distinct entries are consolidated on read. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot <[email protected]>
Tests selector2 / 101 PR test projects · 0 PR jobs, from 6 changed files. Selected PR test projects (2 / 101)
Selected PR jobs (0)none How these were chosen — grouped by what changed🧪 🧪 🧪 🧪 🧪 🧪 Job reasonsnone Selection computed for commit |
Description
Reduce CI test time by removing waits and redundant setup in the CLI and dashboard tests without changing production behavior.
Local Windows measurements showed about 44 seconds less combined test duration across the NuGet, disk cache, streaming, and metric cases. The configuration tests launched 699 Git subprocesses instead of 902 (23% fewer). The second Git run was slower overall, including for unchanged commands, so wall-clock savings for that change are not verified. Test parallelism is unchanged.
Validation
.\restore.cmd— passed.dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-method "*.SearchAsync_ReturnsResultsWhenOneSourceFails" --filter-method "*.SearchAsync_RedactsCredentialBearingAmbientSourceDiagnostics" --filter-method "*.SearchAsync_BoundsPaginationAndReportsWhenResultsMayBeIncomplete" --filter-method "*.DiskCacheTests.*" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"— 10 passed.dotnet test --project tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-restore --no-launch-profile -- --filter-method "*.TelemetryApiServiceTests.Follow*" --filter-method "*.GetInstrument_KnownAttributeValuesIgnoreMergedPerKeyValueLimit" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"— 9 passed.GIT_TRACE2_PERFenabled,dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-method "*.ConfigSourceServiceGitTests.*" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" --report-trx --results-directory $dir --report-trx-filename git-config-after.trx— 79 passed ($dirwas a local scratch directory).Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?