pr-testing
Tests Aspire CLI pull requests by fetching builds and running scenario tests.
Install
mkdir -p .claude/skills/pr-testing-sast-playground && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17889" && unzip -o skill.zip -d .claude/skills/pr-testing-sast-playground && rm skill.zipInstalls to .claude/skills/pr-testing-sast-playground
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Downloads and tests Aspire CLI from a PR build, verifies version, and runs test scenarios based on PR changes. Use this when asked to test a pull request.Key capabilities
- →Parse and validate a PR identifier
- →Download and install the Aspire CLI from a PR build
- →Verify the installed CLI version matches the PR commit
- →Analyze PR changes to categorize them
How it works
The skill extracts PR details, finds the 'Dogfood this PR' link to install the CLI, verifies the CLI version against the PR's commit, and then analyzes PR changes to generate relevant test scenarios.
Inputs & outputs
When to use pr-testing
- →Test a pull request
- →Verify Aspire CLI PR build
- →Run scenario tests for a PR
About this skill
You are a specialized PR testing agent for the dotnet/aspire repository. Your primary function is to download the Aspire CLI from a PR's "Dogfood this PR" comment, verify it matches the PR's latest commit, analyze the PR changes, and run appropriate test scenarios.
Understanding User Requests
Parse user requests to extract:
- PR identifier - either a PR number (e.g.,
12345) or full URL (e.g.,https://github.com/dotnet/aspire/pull/12345)
Example Requests
By PR number:
Test PR 12345
By URL:
Implicit:
Test this PR (when working in a branch with an open PR)
Task Execution Steps
1. Parse and Validate the PR
Extract the PR number from the user's input:
# If URL provided, extract PR number
$prUrl = "https://github.com/dotnet/aspire/pull/12345"
$prNumber = ($prUrl -split '/')[-1]
# Verify PR exists and get details
gh pr view $prNumber --repo dotnet/aspire --json number,title,headRefOid,body,files
2. Get the "Dogfood this PR" Download Link
Fetch the PR comments and find the "Dogfood this PR with:" comment that contains the CLI download instructions:
# Get PR comments to find dogfood instructions
gh pr view $prNumber --repo dotnet/aspire --json comments --jq '.comments[] | select(.body | contains("Dogfood this PR")) | .body'
The comment typically contains instructions like:
Dogfood this PR with:
**Windows (PowerShell):**
irm https://aka.ms/install-aspire-cli.ps1 | iex
aspire config set preview.install.source https://...
**Linux/macOS:**
curl -sSL https://aka.ms/install-aspire-cli.sh | bash
aspire config set preview.install.source https://...
3. Download and Install the CLI
Create a temporary working directory and install the CLI:
# Create temp directory for testing
$testDir = Join-Path $env:TEMP "aspire-pr-test-$(Get-Random)"
New-Item -ItemType Directory -Path $testDir -Force
Set-Location $testDir
# Install CLI using the dogfood instructions
# Follow the platform-specific instructions from the PR comment
4. Verify CLI Version Matches PR Commit
Get the PR's head commit SHA and verify the installed CLI matches:
# Get PR head commit SHA
$prInfo = gh pr view $prNumber --repo dotnet/aspire --json headRefOid | ConvertFrom-Json
$expectedCommit = $prInfo.headRefOid
# Get installed CLI version info
aspire --version
# The version output should contain or reference the commit SHA
# Verify the commit matches
Important: The CLI version must match the PR's latest commit (headRefOid). If it doesn't match, stop and report the version mismatch.
5. Analyze PR Changes
Examine the PR diff to understand what was changed:
# Get changed files
gh pr view $prNumber --repo dotnet/aspire --json files --jq '.files[].path'
# Get the PR diff
gh pr diff $prNumber --repo dotnet/aspire
Categorize the changes:
- CLI changes: Files in
src/Aspire.Cli/ - Hosting changes: Files in
src/Aspire.Hosting*/ - Dashboard changes: Files in
src/Aspire.Dashboard/ - Client/Component changes: Files in
src/Components/ - Template changes: Files in
src/Aspire.ProjectTemplates/ - Test changes: Files in
tests/
6. Generate Test Scenarios
Based on the PR changes, generate appropriate test scenarios. Always use new projects in the temp folder.
Scenario Categories
For CLI changes (src/Aspire.Cli/):
- Test the specific command(s) that were modified
- Run
aspire newto verify basic functionality - Run
aspire runto verify orchestration works - Test any new commands or options added
For Hosting integration changes (src/Aspire.Hosting.*/):
- Create a new Aspire project
- Add the modified resource type to the AppHost
- Run the application and verify the resource starts correctly
- Check the Dashboard shows the resource properly
For Dashboard changes (src/Aspire.Dashboard/):
- Create and run an Aspire application
- Navigate to the Dashboard
- Take screenshots of relevant views
- Verify the modified UI/functionality works
For Template changes (src/Aspire.ProjectTemplates/):
- Test creating projects from each modified template
- Verify the generated project structure
- Run the generated project
For Client/Component changes (src/Components/):
- Create a project that uses the modified component
- Add the corresponding hosting resource
- Test the client can connect to the resource
7. Present Scenarios and Get User Input
Before executing any test scenarios, present a summary of the proposed scenarios to the user and ask for confirmation or additional input using the ask_user tool.
Summary format:
## Proposed Test Scenarios for PR #XXXXX
Based on analyzing the PR changes, I've identified the following test scenarios:
### Detected Changes
- **CLI changes**: [Yes/No] - [brief description if yes]
- **Hosting changes**: [Yes/No] - [brief description if yes]
- **Dashboard changes**: [Yes/No] - [brief description if yes]
- **Template changes**: [Yes/No] - [brief description if yes]
- **Client/Component changes**: [Yes/No] - [brief description if yes]
- **Test changes**: [Yes/No] - [brief description if yes]
### Proposed Scenarios
1. **[Scenario Name]** - [Brief description of what will be tested]
2. **[Scenario Name]** - [Brief description of what will be tested]
3. ...
Then use ask_user to get confirmation:
Call the ask_user tool with the following parameters:
- question: "Would you like me to proceed with these scenarios, or do you have additional scenarios to add?"
- choices: ["Proceed with these scenarios", "Add more scenarios", "Skip some scenarios", "Cancel testing"]
Handle user responses:
- Proceed: Continue to step 8 (Execute Test Scenarios)
- Add more: Ask user to describe additional scenarios, add them to the list, then proceed
- Skip some: Ask which scenarios to skip, remove them, then proceed
- Cancel: Stop testing and report cancellation
This step ensures the user can:
- Verify the analysis is correct
- Add domain-specific scenarios the agent might have missed
- Skip scenarios that aren't relevant
- Provide context about specific features to focus on
8. Execute Test Scenarios
For each scenario, follow this pattern:
# Create a new project directory
$scenarioDir = Join-Path $testDir "scenario-$(Get-Random)"
New-Item -ItemType Directory -Path $scenarioDir -Force
Set-Location $scenarioDir
# Create a new Aspire project
aspire new
# [Add any modifications based on the scenario]
# Run the application
aspire run
# Capture evidence (screenshots, logs)
# Verify expected behavior
9. Capture Evidence
For each test scenario, capture:
Screenshots:
- Dashboard resource list showing all resources running
- Any relevant UI that was modified
- Error states if applicable
Logs:
- Console output from
aspire run - Any error messages
- Resource health status
Commands and Output:
# Capture aspire version
aspire --version | Out-File "$scenarioDir\version.txt"
# Capture run output
aspire run 2>&1 | Tee-Object -FilePath "$scenarioDir\run-output.txt"
10. Generate Detailed Report
Create a comprehensive report with the following structure:
# PR Testing Report
## PR Information
- **PR Number:** #12345
- **Title:** [PR Title]
- **Head Commit:** abc123...
- **Tested At:** [DateTime]
## CLI Version Verification
- **Expected Commit:** abc123...
- **Installed Version:** [output of aspire --version]
- **Status:** ✅ Verified / ❌ Mismatch
## Changes Analyzed
### Files Changed
- `src/Aspire.Cli/Commands/NewCommand.cs` - Modified
- `src/Aspire.Hosting.Redis/RedisResource.cs` - Added
...
### Change Categories
- [x] CLI changes detected
- [ ] Hosting integration changes
- [x] Dashboard changes
...
## Test Scenarios Executed
### Scenario 1: [Scenario Name]
**Objective:** [What this scenario tests]
**Status:** ✅ Passed / ❌ Failed
**Steps:**
1. Created new Aspire project
2. Ran `aspire new`
3. Modified AppHost to add Redis
4. Ran `aspire run`
**Evidence:**
- Screenshot: dashboard-resources.png
- Log: run-output.txt
**Observations:**
- All resources started successfully
- Dashboard displayed Redis resource correctly
---
### Scenario 2: [Scenario Name]
...
## Summary
| Scenario | Status | Notes |
|----------|--------|-------|
| Scenario 1 | ✅ Passed | - |
| Scenario 2 | ❌ Failed | Build error in... |
## Overall Result
**✅ PR VERIFIED** / **❌ ISSUES FOUND**
### Recommendations
- [Any recommendations based on test results]
Error Handling
Version Mismatch
If the installed CLI version doesn't match the PR's head commit:
## ❌ Version Mismatch Detected
- **Expected (PR head):** abc123def456...
- **Installed CLI reports:** xyz789...
**Possible causes:**
1. PR has new commits since the dogfood artifacts were built
2. Artifact cache is stale
3. Installation picked up a different version
**Recommendation:** Wait for CI to rebuild artifacts for the latest commit, then retry.
Missing Dogfood Comment
If no "Dogfood this PR" comment is found:
## ❌ No Dogfood Instructions Found
The PR does not have a "Dogfood this PR with:" comment.
**Possible causes:**
1. PR CI hasn't completed yet
2. PR is a draft or not from a branch that triggers artifact builds
3. CI failed to publish artifacts
**Recommendation:** Check the PR's CI status and wait for it to complete.
Test Scenario Failures
Document failures with full context:
### Scenario: [Name]
**Status:** ❌ Failed
**Error:**
\```
[Full error output]
\```
**Screenshot:** error-state.png
**Logs:**
- Console output: [relevant lines]
- Stack trace: [if applicable]
**Analysis:**
[What likely caused this failure]
**Impact:**
[How this affects users of the PR changes]
Cleanup
After testing completes, clean up temporary dir
Content truncated.
When not to use it
- →When the CLI version does not match the PR's latest commit
- →When the user does not want to test a pull request
- →When the repository is not `dotnet/aspire`
Limitations
- →Specific to `dotnet/aspire` repository
- →Requires 'Dogfood this PR' comment for CLI download
- →Requires `gh` CLI for PR interaction
How it compares
This skill automates the setup and initial analysis for testing a specific PR build of the Aspire CLI, ensuring the correct version is tested and focusing scenarios on actual changes, which is more efficient than manual setup.
Compared to similar skills
pr-testing side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr-testing (this skill) | 0 | 6mo | Review | Intermediate |
| run-helix-tests | 1 | 5mo | Review | Advanced |
| run-integration-tests | 1 | 5mo | Review | Intermediate |
| write-ui-tests | 1 | 6mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
run-helix-tests
dotnet
Submit and monitor .NET MAUI unit tests on Helix infrastructure. Supports running XAML, Resizetizer, Core, Essentials, and other unit test projects on distributed Helix queues.
run-integration-tests
dotnet
Build, pack, and run .NET MAUI integration tests locally. Validates templates, samples, and end-to-end scenarios using the local workload.
write-ui-tests
dotnet
Creates UI tests for a GitHub issue and verifies they reproduce the bug. Iterates until tests actually fail (proving they catch the issue). Use when PR lacks tests or tests need to be created for an issue.
quality-ci
managedcode
Set up or refine open-source .NET code-quality gates for CI: formatting, `.editorconfig`, SDK analyzers, third-party analyzers, coverage, mutation testing, architecture tests, and security scanning. USE FOR: .NET quality gates in CI; analyzer, coverage, mutation, and architecture-test choices; stand
snap
dotnet
Perform a branch snap (release branch cut) for dotnet repos like dotnet/roslyn. Use when: snapping a branch, cutting a release branch, creating a release branch, merging main into release, updating VS insertion config, updating darc subscriptions for a snap, moving milestones, or asked about snap wo
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.