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

[Feature]: TestContainer per arch to run go tests in custom environments #2852

Open
go-dockly opened this issue Oct 27, 2024 · 1 comment
Open
Labels
feature New functionality or new behaviors on the existing one

Comments

@go-dockly
Copy link

go-dockly commented Oct 27, 2024

Problem

It would be a killer feature if we could spin up a go test container dedicated to running golang tests on different platforms.

Solution

Cherry on the cake if one could also define arch eg amd64 on arm [Rosetta emulation on macOS]

Benefit

It's obvious?

Alternatives

Not sure what would be as convenient as using go test containers for what the name suggests ;)

Would you like to help contributing this feature?

Maybe

@go-dockly go-dockly added the feature New functionality or new behaviors on the existing one label Oct 27, 2024
@mdelapenya
Copy link
Member

Hey @go-dockly thanks for opening this feature request. I'd like to know more about this: do you envision a way to create a container in a given platform and put the workspace into it to run the tests?

Please consider that testcontainers is a developer-friendly wrapper of the Docker package, so I think what you propose could be done as a separate project (maybe a CLI) that uses tc-go as runtime, so you run your binary, say gotc (go testcontainers) like this:

gotc --platform=amd64 --goversion=1.23.1

And it would use tc-go to spin up a container in the desired flavour (go version + platform), then mount the current workspace into the container, and finally run the tests.

Does this resonate to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

No branches or pull requests

2 participants