-
Notifications
You must be signed in to change notification settings - Fork 90
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
Support TestContainers PoC #4627
Conversation
1- Allow us to run integration tests against a docker compose deployment of bacalhau 2- Bacalhau compute/requestor configuration can be injected in the container before start. We do not need to rebuild it every time 3- Tests are separated into suites which allows the combination of similar tests together that will use the same docker compose deployment. Help speed up things 4- Docker compose deployment has a local registry as well as a minio server running. This expands out testing ability and scope. 5- Test Suite Works with Github Actions Linear issue tracker: ENG-263 Github Issue: #4597
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.
Looks good overall. Nice work! Though taking 4 minutes to run just two scenarios seem too long and I hope we can improve things in upcoming iterations
jobID, err := extractJobIDFromShortOutput(result) | ||
s.Require().NoErrorf(err, "error extracting Job ID after running it: %q", err) | ||
|
||
completedIn, err := s.waitForJobToComplete(jobID, 30*time.Second) |
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.
will be great to reuse the state resolvers we already have
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.
I thought about it while developing the test suite, my approach was to avoid using any internal Bacalhau packages in this suite to prevent leaking internal implementation details into these tests. Currently, the state resolvers are importing packages from within the main Bacalhau codebase. This concern was one of the primary reasons I introduced test_integration as a separate Go module, establishing a clear boundary. This approach effectively treats the entire Bacalhau deployment as a black box.
With that said, I will be reviewing the state resolvers and see what I can extrtact from them to help us with the tests.
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.
LGTM
Linear issue tracker: https://linear.app/expanso/issue/ENG-263/explore-testcontainers-to-utilize-in-testing-strategy Github Issue: #4597
@wdbaruni Thank you.
|
Linear issue tracker: https://linear.app/expanso/issue/ENG-263/explore-testcontainers-to-utilize-in-testing-strategy Github Issue: #4597
Linear issue tracker: https://linear.app/expanso/issue/ENG-263/explore-testcontainers-to-utilize-in-testing-strategy Github Issue: #4597
This PR adds a test suite utilizing TestContainers. It support spinning up docker compose stacks with all bacalhau components, thus resembling production setup.
This is not a complete TestSuite, but a big initial step towards consolidating out testing and evaluating TestContainers usage.
Allow us to run integration tests against a docker compose
deployment of bacalhau
Bacalhau compute/requestor configuration can be injected in the
container before start. We do not need to rebuild it every time
Tests are separated into suites which allows the combination of
similar tests together that will use the same docker compose
deployment. Help speed up things
Docker compose deployment has a local registry as well as a minio
server running. This expands out testing ability and scope.
Test Suite Works with Github Actions
Linear issue tracker: ENG-263
Github Issue: #4597