tnc1997 / azure-app-configuration-emulator

Please note that Emulator for Azure App Configuration is unofficial and not endorsed by Microsoft.
MIT License
3 stars 3 forks source link

Create a Testcontainers module to support easy testing. #87

Open goldsam opened 1 month ago

goldsam commented 1 month ago

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:

tnc1997 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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:

goldsam commented 1 month ago

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

tnc1997 commented 1 month ago

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 commented 1 month ago

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