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

feat: reusable containers #757

Merged
merged 22 commits into from
Dec 17, 2024

Conversation

the-wondersmith
Copy link
Contributor

PR implements reusable containers inline with the existing reusable containers feature(s) of testcontainers for other languages.

Important

This PR follows from (and is branched from) #756. PR 756 must be merged prior to merging this PR

Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for testcontainers-rust ready!

Name Link
🔨 Latest commit bc3142f
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-rust/deploys/67603e8772fff90008589e34
😎 Deploy Preview https://deploy-preview-757--testcontainers-rust.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.

@the-wondersmith
Copy link
Contributor Author

@DDtKey Dug into the test failures, and it looks like it's just cargo hack not including experimental when it tries to activate the reusable-containers feature.

I updated the CI action to fix it, but (for obvious reasons) GHA won't run actions from forks / PR branches (usually).

Not sure how to proceed here, got any thoughts?

@DDtKey
Copy link
Collaborator

DDtKey commented Dec 9, 2024

Actually, I think we can avoid usage of experimental feature.
It's already under separate feature and we can just claim in documentation that it's "experimental" functionality. It's not enabled by default and users anyway should read something about the feature before enabling it.

But regarding your question, CI works with your changes (if I got you correctly):
https://github.com/testcontainers/testcontainers-rs/actions/runs/12200812163/job/34037798890?pr=757

running `cargo test --no-default-features --features experimental,reusable-containers` on testimages (67/67)
  error: the package 'testimages' does not contain these features: experimental, reusable-containers
  help: package with the missing features: testcontainers

It fails on testimages. For testcontainers all tests have passed as far as I can see.

@the-wondersmith
Copy link
Contributor Author

Actually, I think we can avoid usage of experimental feature. It's already under separate feature and we can just claim in documentation that it's "experimental" functionality. It's not enabled by default and users anyway should read something about the feature before enabling it.

Fair enough. Removed the experimental feature and reverted the CI changes 🙂

Copy link
Collaborator

@DDtKey DDtKey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all efforts! ❤️

I've left a few comments, please take a look

testcontainers/src/core/client.rs Outdated Show resolved Hide resolved
testcontainers/src/runners/async_runner.rs Show resolved Hide resolved
Copy link
Collaborator

@DDtKey DDtKey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like what you've built here. Thank you a lot and sorry for all the delays 🙏

Only few minor comments and LGTM

Next milestones for this feature are:

  • env-variable control
  • proper reaper for "current session" (ryuk)

testcontainers/src/core/image/image_ext.rs Outdated Show resolved Hide resolved
@DDtKey DDtKey merged commit af21727 into testcontainers:main Dec 17, 2024
12 checks passed
@the-wondersmith the-wondersmith deleted the feat/reusable-containers branch December 18, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants