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

fix: Postpone exception in DbContainerFixture to match the behavior of ContainerFixture #1310

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Nov 28, 2024

What does this PR do?

This pull request fixes a discrepancy between ContainerFixture and DbContainerFixture. Accessing the ConnectionString property in the Testcontainers.Xunit.DbContainerFixture<TBuilderEntity,TContainerEntity>.InitializeAsync method might throw. Using a Lazy<string> instead makes it throw when the fixture is actually used.

Why is it important?

To make ContainerFixture and DbContainerFixture have a consistent behaviour.

Related issues

I discovered this issue while helping someone here: xunit/xunit#3066

Copy link

netlify bot commented Nov 28, 2024

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 8308b97
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/674c37a291f0e500083ce4d6
😎 Deploy Preview https://deploy-preview-1310--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@HofmeisterAn HofmeisterAn changed the title fix: Postpone exception in DbContainerFixture to match the behaviour of ContainerFixture fix: Postpone exception in DbContainerFixture to match the behavior of ContainerFixture Dec 1, 2024
@HofmeisterAn HofmeisterAn added the bug Something isn't working label Dec 1, 2024
@HofmeisterAn HofmeisterAn merged commit e982134 into testcontainers:develop Dec 1, 2024
56 checks passed
@0xced 0xced deleted the Fix-DbContainerFixture branch December 1, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants