Skip to content

Add testcontainers-dotnet skill for .NET integration testing#4

Merged
mdelapenya merged 24 commits into
mainfrom
copilot/add-testcontainers-dotnet-skill
Mar 4, 2026
Merged

Add testcontainers-dotnet skill for .NET integration testing#4
mdelapenya merged 24 commits into
mainfrom
copilot/add-testcontainers-dotnet-skill

Conversation

Copilot AI commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Adds testcontainers-dotnet skill to enable Claude to guide .NET developers writing integration tests with Docker containers, following the established testcontainers-go pattern.

Structure

Skill documentation (plugins/testcontainers/skills/testcontainers-dotnet/SKILL.md)

  • Comprehensive documentation with inline code examples covering all major use cases
  • Coverage of 40+ pre-configured modules (PostgreSQL, SQL Server, Redis, MongoDB, Kafka, etc.)
  • .NET-specific patterns: IAsyncLifetime, builder API, test framework integration (xUnit, NUnit, MSTest)
  • Entity Framework Core integration examples
  • Wait strategies, networking, and troubleshooting guidance
  • Framework-agnostic best practices applicable to all major .NET test frameworks
  • Link to browse available modules on testcontainers.com

Repository integration

  • Updated README.md and marketplace.json to register skill
  • Reorganized into new plugins/testcontainers/skills/ directory structure
  • Created plugins/testcontainers/.claude-plugin/plugin.json with plugin metadata
  • Extended CI workflow with conditional execution based on changed paths to optimize build performance

Design Decision

The skill contains only SKILL.md and LICENSE files. Unlike the Go skill, no separate examples directory is included because:

  • SKILL.md already contains comprehensive inline code examples covering all key scenarios
  • This approach reduces duplication and simplifies maintenance
  • All necessary information for .NET developers is available in the markdown documentation

Example Usage

public class DatabaseTests : IAsyncLifetime
{
    private readonly PostgreSqlContainer _postgres = new PostgreSqlBuilder("postgres:16-alpine").Build();

    public async Task InitializeAsync() => await _postgres.StartAsync();
    public async Task DisposeAsync() => await _postgres.DisposeAsync();

    [Fact]
    public async Task CanConnectToDatabase()
    {
        var connectionString = _postgres.GetConnectionString();
        await using var connection = new NpgsqlConnection(connectionString);
        await connection.OpenAsync();
        Assert.NotNull(connection);
    }
}
Original prompt

Analyse the testcontainers-go skill that is present as a directory in the root of the repository, and work on adding a testcontainers-dotnet skill.
Use the information from the following sources of truth:

The skill must live in a testcontainers-dotnet directory in the root, and you must ping @HofmeisterAn as reviewer of your work.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 2, 2026 13:31
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Copilot AI changed the title [WIP] Add testcontainers-dotnet skill to repository Add testcontainers-dotnet skill for .NET integration testing Jan 2, 2026
Copilot AI requested a review from mdelapenya January 2, 2026 13:38
Comment thread plugins/testcontainers/skills/testcontainers-dotnet/SKILL.md
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Comment thread .github/workflows/test-skills.yml Outdated
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Comment thread README.md
Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
Copilot AI requested a review from mdelapenya January 2, 2026 14:24
@mdelapenya mdelapenya added the enhancement New feature or request label Jan 2, 2026
Comment thread .github/CODEOWNERS Outdated
- Move testcontainers-go to plugins/testcontainers/skills/testcontainers-go/
- Move testcontainers-dotnet to plugins/testcontainers/skills/testcontainers-dotnet/
- Create plugins/testcontainers/.claude-plugin/plugin.json
- Update marketplace.json to reference single testcontainers plugin
- Update workflow to use new paths for both skills
- Update README with new paths and installation instructions
- Remove old directories and CODEOWNERS file
- Both .NET and Go examples build successfully in new locations

Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the project layout changed a bit in main. Can you update the current state of this PR to match the new layout?

Updated the PR to match the new plugin layout structure in commit 53e032d.

Changes made:

  • Reorganized both testcontainers-go and testcontainers-dotnet into plugins/testcontainers/skills/ directory structure
  • Created plugins/testcontainers/.claude-plugin/plugin.json with plugin metadata
  • Updated marketplace.json to reference single testcontainers plugin at ./plugins/testcontainers
  • Updated GitHub Actions workflow to use new paths for both Go and .NET examples
  • Updated README with new file paths and installation instructions
  • Removed old directories and CODEOWNERS file
  • Verified both .NET and Go examples build successfully in new locations

Comment thread .github/workflows/test-skills.yml Outdated
- '.github/workflows/test-skills.yml'

jobs:
test-testcontainers-go:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot in your last commit, you removed the change detection job, and duplicated this one. Re-add it, keeping the output validation for the Go steps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-added the detect-changes job with proper conditional execution in commit fd2e8e6.

Changes made:

  • Added detect-changes job using dorny/paths-filter action
  • Updated path filters to monitor plugins/testcontainers/skills/testcontainers-go/** and plugins/testcontainers/skills/testcontainers-dotnet/**
  • Both test jobs now depend on detect-changes and only run when their respective paths change
  • Removed the duplicate test-testcontainers-go job definition
  • Kept all Go validation steps (compile, download dependencies, vet, format checks, and tests)

- Add detect-changes job with dorny/paths-filter action
- Update path filters to use new plugins/testcontainers/skills/ structure
- Make both test-testcontainers-go and test-testcontainers-dotnet depend on detect-changes
- Add conditional execution (if: needs.detect-changes.outputs.{go|dotnet} == 'true')
- Remove duplicate test-testcontainers-go job definition
- Keep all Go validation steps (compile, vet, format checks)

Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>
@mdelapenya

Copy link
Copy Markdown
Member

@copilot can you resolve the conflicts for merging this branch with main?

Resolved merge conflicts to bring PR up to date with main branch:

- .claude-plugin/marketplace.json: Kept comprehensive keywords including .NET-specific terms
- .github/workflows/test-skills.yml: Removed workflow-level path filters (using detect-changes job instead)
- README.md: Kept correct plugin paths and complete .NET skill documentation

Both Go and .NET examples verified to build successfully.

Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot can you resolve the conflicts for merging this branch with main?

Resolved all merge conflicts with main branch in commit fc5d01e.

Changes made:

  • marketplace.json: Kept comprehensive keyword list including .NET-specific terms (csharp, sqlserver, entityframework, etc.) for better discoverability
  • test-skills.yml: Removed workflow-level path filters since we're using the detect-changes job for conditional execution (more flexible approach)
  • README.md: Kept correct plugin paths (plugins/testcontainers/skills/) and complete .NET skill documentation

Both Go and .NET examples verified to build successfully after merge.

@mdelapenya

Copy link
Copy Markdown
Member

@copilot the branch still has merge conflicts, please go and resolve them

Resolved conflicts in three files:

1. .claude-plugin/marketplace.json
   - Kept comprehensive keyword list including .NET-specific terms (csharp, sqlserver, entityframework, etc.)
   - Preserves better discoverability for both Go and .NET developers

2. .github/workflows/test-skills.yml
   - Removed workflow-level path filters from origin/main (redundant with detect-changes job)
   - Using detect-changes job for more flexible conditional execution

3. README.md
   - Kept correct plugin paths (plugins/testcontainers/skills/)
   - Preserved complete .NET skill documentation section
   - Both Go and .NET skills properly documented

Verified both Go and .NET examples build successfully after merge.

Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the branch still has merge conflicts, please go and resolve them

Resolved all merge conflicts with main branch in commit aaff97d.

Resolved conflicts:

  • .claude-plugin/marketplace.json: Kept comprehensive keywords including .NET-specific terms
  • .github/workflows/test-skills.yml: Removed redundant workflow-level path filters (using detect-changes job instead)
  • README.md: Kept correct plugin paths and complete .NET skill documentation

Both Go and .NET examples verified to build successfully after merge.

@HofmeisterAn HofmeisterAn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdelapenya since you mentioned it on Slack, WDYT about removing the .NET examples and starting with SKILL.md instead? The markdown file is cleaner and currently contains all the information from the examples and more. I think it's better to publish it so it can be used and discovered, and then improve it step by step.

@mdelapenya

Copy link
Copy Markdown
Member

WDYT about removing the .NET examples and starting with SKILL.md instead? The markdown file is cleaner and currently contains all the information from the examples and more.

Sounds good to me!

@copilot can you just do what Andre suggested?

As discussed, the SKILL.md file contains all the necessary information and examples, making the separate examples directory redundant. This simplifies maintenance and reduces duplication.

Changes:
- Removed plugins/testcontainers/skills/testcontainers-dotnet/examples/ directory entirely
- Removed test-testcontainers-dotnet job from GitHub Actions workflow
- Updated detect-changes job to remove dotnet output
- testcontainers-dotnet skill now consists of LICENSE and SKILL.md only

The SKILL.md file remains comprehensive with all code examples, best practices, and documentation needed for .NET developers.

Co-authored-by: mdelapenya <951580+mdelapenya@users.noreply.github.com>

Copilot AI commented Feb 28, 2026

Copy link
Copy Markdown
Contributor Author

WDYT about removing the .NET examples and starting with SKILL.md instead? The markdown file is cleaner and currently contains all the information from the examples and more.

Sounds good to me!
...

Removed the .NET examples directory in commit bb43f6e. The testcontainers-dotnet skill now contains only LICENSE and SKILL.md, which has all the comprehensive documentation and code examples needed for .NET developers.

@mdelapenya mdelapenya marked this pull request as ready for review March 4, 2026 11:05
@mdelapenya

Copy link
Copy Markdown
Member

@HofmeisterAn ship it?

@mdelapenya mdelapenya merged commit 5263fe4 into main Mar 4, 2026
4 checks passed
@HofmeisterAn

Copy link
Copy Markdown
Contributor

@HofmeisterAn ship it?

@mdelapenya Yes, please 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants