-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
feat(ServiceBus): Add support to use existing MSSQL container instances #1335
Conversation
… ServiceBusContainer
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
tests/Testcontainers.ServiceBus.Tests/ServiceBusContainerWithCustomMsSqlTest.cs
Outdated
Show resolved
Hide resolved
…ontainers from derived classes
…sSqlContainer for default setup
…g a custom instance
…lass with private constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I've slightly rearranged the Build()
method and added INetwork
as an argument to WithMsSqlContainer(...)
. I believe it feels more natural for developers to pass the network along with the container instance, as this way they don't have to remember to add the Service Bus Container to the same network. It's more likely to be configured correctly this way, I think. Let me know what you think. I'm happy to merge the PR if you're okay with the changes. Thanks ✌️.
Hey @HofmeisterAn, I agree with you, it makes sense to pass the |
What does this PR do?
This PR exposes an overload of
WithMsSqlContainer
, enabling users to attach an existingMsSqlContainer
instance to the Azure Service Bus emulator. Previously, ServiceBusContainer automatically spun up its own SQL Server container, leading to unnecessary duplication when users were already testing with Azure Service Bus and SQL Server (see #1323).Why is it important?
This enhancement addresses the resource usage issues described in #1323. By allowing a single
MsSqlContainer
to be shared, the overhead of launching a separate SQL Server container to use the Azure Service Bus emulator is eliminated. This can be especially beneficial in CI/CD scenarios or other environments where minimizing resource consumption and reducing test execution time is a priority.Related issues
How to test this PR
MsSqlContainer
toServiceBusContainer
.ServiceBusContainer
andMsSqlContainer
) are on the same network.mcr.microsoft.com/azure-sql-edge:latest
.mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
(the default inMsSqlBuilder
) is not spun up.Follow-ups
None at this time. Inline summary documentation is included in the new overload.