Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Testcontainers module to support easy testing. #87

Open
goldsam opened this issue Jun 12, 2024 · 9 comments
Open

Create a Testcontainers module to support easy testing. #87

goldsam opened this issue Jun 12, 2024 · 9 comments
Assignees

Comments

@goldsam
Copy link

goldsam commented Jun 12, 2024

It would be valuable to support a Testcontainers module to quickly enable integration tests dependant on azure-app-configuration-emulator.

Testcontainers is a popular library use for defining and managing complex container environments for integration testing. This library introduces the concept of a module as an extension library which enables complex automatic configuration and best practices when integrating specific 3rd-party applications.

Although the Testcontainers project provides modules for many commonly used applications, other projects (such as WireMock.Net) provide their own Testcontainers modules.

The features I would like in this module:

  • Automatic provisioning and deployment of a self-signed certificate deployed and configured into the azure-app-configuration-emulator container.
  • Helper functions for computing an App Configuration endpoint Uri for use both from the host and within the containerized environment (using a host alias).
  • Helper function for creating an ConfigurationClient for use within the test environment to setup configuration during a test.
@tnc1997 tnc1997 self-assigned this Jun 12, 2024
@tnc1997
Copy link
Owner

tnc1997 commented Jun 12, 2024

I must confess that I have not heard of Testcontainers however on first glance they certainly look very useful.

I would like to have a play with Testcontainers over the next week but then we should be able to progress this.

@goldsam
Copy link
Author

goldsam commented Jun 12, 2024

I have an implementation I created in the context of another project, I can create a branch and PR for you take a look at in the next day or two.

Can you create a branch for this work that I can open up a PR against?

Also, this would depend on #75

@tnc1997
Copy link
Owner

tnc1997 commented Jun 12, 2024

I appreciate that this depends on #75 which I am working on as we speak funnily enough 😄

I would appreciate a twin issue being opened in the Testcontainers repository for .NET in the first instance.

I don't suppose that you would be willing to open this so that we could collaborate with the Testcontainers maintainers?

https://github.com/testcontainers/testcontainers-dotnet/blob/develop/docs/contributing.md

If you don't mind I would like to get to know Testcontainers better before implementing or reviewing any related changes.

@goldsam
Copy link
Author

goldsam commented Jun 12, 2024

Are you sure you don't want to maintain that module within your own project as WireMock.Net did? You would be relinquishing your control....

@tnc1997
Copy link
Owner

tnc1997 commented Jun 12, 2024

I must admit that I am in two minds regarding where to maintain that module.

I think that it probably makes sense to maintain it alongside the other Testcontainers modules and publish it as Testcontainers.AzureAppConfiguration or similar.

@goldsam
Copy link
Author

goldsam commented Jun 12, 2024

The Testcontainers prefix is reserved on nuget.org by the Testcontainers project. You would not be able to publish with that package name if the code is in your repo,.

I would recommend AzureAppConfigurationEmulator.Testcontainers since:

  • The main application project is already using the AzureAppConfigurationEmulator root namespace
  • This avoids confusion with components that talk to the real Azure App Configuration service
  • It is consistent with other projects such as WireMock.Net.Testcontainers.

@goldsam
Copy link
Author

goldsam commented Jun 13, 2024

@tnc1997 Take a look at my initial work (which is far from complete) and tell me what you think.

@tnc1997
Copy link
Owner

tnc1997 commented Jun 13, 2024

The Testcontainers prefix is reserved on nuget.org by the Testcontainers project. You would not be able to publish with that package name if the code is in your repo.

This is one of the reasons that I would like to first reach out to the Testcontainers maintainers before progressing this.

testcontainers/testcontainers-dotnet#1198

@goldsam
Copy link
Author

goldsam commented Jun 13, 2024

The functionality exposed through your app/container should be consistent with your Testcontainers library. I would recommend just maintaining it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants