testcontainers / testcontainers-go

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
https://golang.testcontainers.org
MIT License
3.3k stars 450 forks source link

fix: allow compose files and readers to be used together #2598

Closed BoKleynen closed 1 week ago

BoKleynen commented 1 week ago

What does this PR do?

Both WithStackFiles and WithStackReaders assign to the Paths field of the composeStackOptions which would result in the last option to overwrite all earlier options.

The documentation specifies that it's possible to use both files and readers.

This PR aligns the implementation with the documentation by appending to the Paths field instead of overwriting it.

Why is it important?

Align the implementation with what one would expect from the documentation

How to test this PR

I've included a test that includes both a file and a reader

netlify[bot] commented 1 week ago

Deploy Preview for testcontainers-go ready!

Name Link
Latest commit 63f5278ec2bde07433931aac1e3859a6aa13000f
Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/667339cc0f96850008301397
Deploy Preview https://deploy-preview-2598--testcontainers-go.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.