seiggy/lucia-dotnet/aspire-integration-testing
Claude Code and agent skill by seiggy/lucia-dotnet
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Write integration tests using .NET Aspire's testing facilities with xUnit. Covers test fixtures, distributed application setup, endpoint discovery, and patterns for testing ASP.NET Core apps with real dependencies.
Install
npx vskill@latest install seiggy/lucia-dotnet/aspire-integration-testingSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as seiggy/lucia-dotnet/aspire-integration-testing.
Integration Testing with .NET Aspire + xUnit
When to Use This Skill
Use this skill when:
- Writing integration tests for .NET Aspire applications
- Testing ASP.NET Core apps with real database connections
- Verifying service-to-service communication in distributed applications
- Testing with actual infrastructure (SQL Server, Redis, message queues) in containers
- Combining Playwright UI tests with Aspire-orchestrated services
- Testing microservices with proper service discovery and networking
Core Principles
- Real Dependencies - Use actual infrastructure (databases, caches) via Aspire, not mocks
- Dynamic Port Binding - Let Aspire assign ports dynamically (
127.0.0.1:0) to avoid conflicts - Fixture Lifecycle - Use
IAsyncLifetimefor proper test fixture setup and teardown - Endpoint Discovery - Never hard-code URLs; discover endpoints from Aspire at runtime
- Parallel Isolation - Use xUnit collections to control test parallelization
- Health Checks - Always wait for services to be healthy before running tests
High-Level Testing Architecture
Required NuGet Packages
CRITICAL: File Watcher Fix for Integration Tests
When running many integration tests that each start an IHost, the default .NET host builder enables file watchers for configuration reload. This exhausts file descriptor limits on Linux.
Add this to your test project before any tests run:
Why this matters: [ModuleInitializer] runs before any test code executes, setting the environment variable globally for all IHost instances created during tests.
Pattern 1: Basic Aspire Test Fixture (Modern API)
Pattern 2: Using the Fixture in Tests
Pattern 3: Endpoint Discovery
Pattern 4: Testing with Database Dependencies
Pattern 5: Combining with Playwright for UI Tests
Pattern 6: Conditional Resource Configuration for Tests
Design your AppHost to support different configurations for interactive development (F5/CLI) vs automated test fixtures. The pattern goes beyond just volumes - it covers execution modes, authentication, external services, and more.
Core Principle
Default to production-like behavior in AppHost. Tests explicitly override what they need to be different. This catches configuration gaps early (e.g., missing DI registrations that only surface in clustered mode).
Configuration Class in AppHost
AppHost Conditional Logic
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/aspire-integration-testing/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 7
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/seiggy/lucia-dotnet/aspire-integration-testing)