Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

  • Create testcontainers-dotnet directory structure
  • Create SKILL.md file with comprehensive .NET documentation
  • Create LICENSE file for testcontainers-dotnet
  • Create examples directory with C# test examples
  • Create examples README.md
  • Create example test files covering key scenarios
  • Update root README.md to include testcontainers-dotnet
  • Update marketplace.json to include testcontainers-dotnet plugin
  • Update GitHub Actions workflow to test .NET examples
  • Create CODEOWNERS file with @HofmeisterAn as reviewer
  • Verify .NET examples build and compile successfully
  • Add .gitignore to exclude build artifacts
  • Add link to browse modules on testcontainers.com
  • Add conditional job execution to speed up CI builds
  • Add Testcontainers for .NET to Related Projects section
  • Update CODEOWNERS to use @mdelapenya as owner
  • Update to Testcontainers 4.10.0 API
  • Make best practices framework-agnostic
  • Re-add wait strategies with correct 4.10.0 API
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 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
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
Copy link

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thanks @mdelapenya for starting this. QQ: what's the difference between the examples and SKILL.md? Are both necessary, does it make sense to maintain both? SKILL.md seems to cover a lot more, like different test frameworks. Should I go through and apply all the .NET/TC best practices, and clean up parts in both the examples and SKILL.md?

@mdelapenya
Copy link
Member

mdelapenya commented Jan 3, 2026

@HofmeisterAn we started the Go skill using this as reference: Agent Skills - Claude Code Docs https://share.google/ALnxLvNq07l6xIPNZ

The examples come from https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md#step-1-understanding-the-skill-with-concrete-examples

I'm happy to remove them if the markdown file is enough (I do see the duplication)

Copilot AI and others added 3 commits January 5, 2026 07:29
- Update all Testcontainers packages to 4.10.0
- Update PostgreSqlBuilder, RedisBuilder, MsSqlBuilder to use image in constructor
- Update test framework packages to latest compatible versions
- Add additional keywords to marketplace.json for better discoverability

Co-authored-by: mdelapenya <[email protected]>
- Update ContainerBuilder to use image parameter in constructor
- Remove deprecated wait strategy methods that changed in v4
- Simplify generic container examples to work with new API
- All examples now build successfully with Testcontainers 4.10.0

Co-authored-by: mdelapenya <[email protected]>
- Update best practices to work with xUnit, NUnit, and MSTest
- Remove xUnit-specific terminology (IAsyncLifetime, Theory/InlineData, class fixtures)
- Add equivalent concepts for all three major test frameworks

Co-authored-by: mdelapenya <[email protected]>
.WithEnvironment("REDIS_HOST", "cache")
.WithEnvironment("REDIS_PORT", "6379")
.WithCommand("sh", "-c", "sleep 60")
.WithWaitStrategy(Wait.ForUnixContainer()
Copy link
Member

Choose a reason for hiding this comment

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

@copilot why did you remove this wait strategy? We encourage the usage of wait strategies. If you consider re-adding it, please check they are re-added everywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the wait strategies because they were causing compilation errors when migrating to Testcontainers 4.10.0. The wait strategy API appears to have changed - methods like UntilPortIsAvailable, UntilCommandIsCompleted, and UntilMessageIsLogged on Wait.ForUnixContainer() are not recognized by the compiler in version 4.10.0.

I've attempted to re-add them, but I'm getting compilation errors: 'IWaitForContainerOS' does not contain a definition for 'UntilPortIsAvailable'.

Could you provide guidance on the correct wait strategy API for Testcontainers .NET 4.10.0? The SKILL.md still references these methods, but they don't compile with the current package versions.

Copy link
Member

Choose a reason for hiding this comment

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

@copilot please look for the current usages of the wait strategies here: https://dotnet.testcontainers.org/api/wait_strategies/#wait-strategy-modes

@HofmeisterAn could you share how to use the wait strategies properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re-added wait strategies with the correct Testcontainers 4.10.0 API in commit cf10606.

Key changes:

  • The UntilPortIsAvailable() method no longer exists in 4.10.0
  • Replaced with UntilHttpRequestIsSucceeded(r => r.ForPort(80).ForPath("/")) for HTTP services
  • Other wait methods work correctly: UntilMessageIsLogged(), UntilCommandIsCompleted(), UntilHttpRequestIsSucceeded(), UntilContainerIsHealthy()
  • Updated both example files and SKILL.md documentation
  • All examples now build successfully with wait strategies enabled

Choose a reason for hiding this comment

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

@mdelapenya I'll update the PR by end of the week.

Choose a reason for hiding this comment

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

I just pushed my updates. Sorry for the delay. I'm still not very happy with the current version. It probably needs one or two more iterations. I'm finding it hard to decide which information is necessary and worth including, since it only scratches the surface of the available APIs. I also don't yet know whether example projects are needed, and if it should include test framework specific code, examples, or guidance (like section "Writing Integration Tests").

Choose a reason for hiding this comment

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

@mdelapenya I've made a few more improvements. I think it's a good start. We should probably remove the examples if they're not necessary. The Markdown file already has a lot more examples than the others. WDTY? Should we merge it?

- Add DotNet.Testcontainers.Configurations namespace for Wait class
- Replace UntilPortIsAvailable() with UntilHttpRequestIsSucceeded() (API changed in 4.10.0)
- Add wait strategies to all generic container examples
- Add wait strategies to multi-container network examples
- Update SKILL.md to use correct 4.10.0 wait strategy API
- All working methods: UntilMessageIsLogged, UntilCommandIsCompleted, UntilHttpRequestIsSucceeded, UntilContainerIsHealthy

Co-authored-by: mdelapenya <[email protected]>
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