Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
"keywords": ["testcontainers", "go", "docker", "integration-testing", "testing", "containers", "databases", "postgres", "redis", "kafka", "mysql", "mongodb"],
"category": "development",
"strict": false
},
{
"name": "testcontainers-dotnet",
"source": "./testcontainers-dotnet",
"description": "A comprehensive guide for using Testcontainers for .NET to write reliable integration tests with Docker containers in .NET projects. Supports 65+ pre-configured modules for databases, message queues, cloud services, and more.",
"version": "1.0.0",
"author": {
"name": "Testcontainers",
"email": "info@testcontainers.org"
},
"keywords": ["testcontainers", "dotnet", "csharp", "containers", "docker", "integration-testing", "testing", "mstest", "nunit", "xunit", "databases", "mongodb", "postgres", "sqlserver", "message-queues", "redis", "rabbitmq", "kafka", "entityframework"],
"category": "development",
"strict": false
}
]
}
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CODEOWNERS file for testcontainers/claude-skills repository
#
# This file defines code ownership for the repository.
# Reviewers will be automatically requested for pull requests that modify the specified paths.
#
# For more information, see:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# testcontainers-go skill
/testcontainers-go/ @mdelapenya

# testcontainers-dotnet skill
/testcontainers-dotnet/ @HofmeisterAn @mdelapenya
78 changes: 72 additions & 6 deletions .github/workflows/test-skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,40 @@ name: Test Skills
on:
push:
branches: [ main, copilot/** ]
paths:
- 'testcontainers-go/**'
- '.github/workflows/test-skills.yml'
pull_request:
branches: [ main ]
paths:
- 'testcontainers-go/**'
- '.github/workflows/test-skills.yml'

jobs:
detect-changes:
name: Detect changes
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
go: ${{ steps.filter.outputs.go }}
dotnet: ${{ steps.filter.outputs.dotnet }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Check for file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
go:
- 'testcontainers-go/**'
- '.github/workflows/test-skills.yml'
dotnet:
- 'testcontainers-dotnet/**'
- '.github/workflows/test-skills.yml'

test-testcontainers-go:
name: Test testcontainers-go examples
runs-on: ubuntu-latest
needs: detect-changes
if: needs.detect-changes.outputs.go == 'true'
permissions:
contents: read

Expand Down Expand Up @@ -75,3 +96,48 @@ jobs:
# Tests will automatically pull required Docker images
go test -v -timeout 10m ./...
echo "✅ All tests passed!"

test-testcontainers-dotnet:
name: Test testcontainers-dotnet examples
runs-on: ubuntu-latest
needs: detect-changes
if: needs.detect-changes.outputs.dotnet == 'true'
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
working-directory: testcontainers-dotnet/examples
run: |
echo "Restoring .NET dependencies..."
dotnet restore
echo "✅ Dependencies restored!"

- name: Build examples
working-directory: testcontainers-dotnet/examples
run: |
echo "Building .NET test project..."
dotnet build --no-restore --configuration Release
echo "✅ Build successful!"

- name: Set up Docker
run: |
echo "Docker is available in GitHub Actions runners by default"
docker --version

- name: Run tests
working-directory: testcontainers-dotnet/examples
run: |
echo "Running .NET tests..."
# Run tests with verbose output and a timeout since they involve container operations
# Tests will automatically pull required Docker images
dotnet test --no-build --configuration Release --logger "console;verbosity=detailed" --blame-hang-timeout 10m
echo "✅ All tests passed!"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ A comprehensive guide for using Testcontainers for Go to write reliable integrat

See the [testcontainers-go skill documentation](./testcontainers-go/SKILL.md) for detailed usage instructions and examples.

### testcontainers-dotnet
A comprehensive guide for using Testcontainers for .NET to write reliable integration tests with Docker containers in .NET projects. This skill provides:

- Support for 65+ pre-configured modules for databases, message queues, cloud services, and more
- Best practices for setting up and managing Docker containers in .NET tests (xUnit, NUnit, MSTest)
- Configuration guidance for networking, volumes, and environment variables
- Proper cleanup and resource management patterns with IAsyncLifetime
- Debugging and troubleshooting techniques

**Key capabilities:**
- Use pre-configured modules (PostgreSQL, SQL Server, Redis, MongoDB, Kafka, and more)
- Write integration tests with real services instead of mocks
- Test against multiple versions or configurations of dependencies
- Create reproducible test environments with Entity Framework Core
- Set up ephemeral test infrastructure

See the [testcontainers-dotnet skill documentation](./testcontainers-dotnet/SKILL.md) for detailed usage instructions and examples.

## Try in Claude Code, Claude.ai, and the API

### Claude Code
Expand Down Expand Up @@ -137,6 +155,7 @@ This repository is licensed under the MIT License. See the [LICENSE](./LICENSE)
## Related Projects

- [Testcontainers for Go](https://github.com/testcontainers/testcontainers-go) - The main Testcontainers for Go library
- [Testcontainers for .NET](https://github.com/testcontainers/testcontainers-dotnet) - The main Testcontainers for .NET library
- [Testcontainers](https://testcontainers.com/) - Official Testcontainers website
- [Anthropic Skills](https://github.com/anthropics/skills) - Main skills repository with additional examples

Expand Down
21 changes: 21 additions & 0 deletions testcontainers-dotnet/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Testcontainers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading