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(wait): for file #2731

Merged
merged 3 commits into from
Sep 3, 2024
Merged

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Aug 12, 2024

Add the ability to wait for a file and optionally its contents.

This leverages generated mocks using mockery and testify/mock to make testing easier.

Add the ability to wait for a file and optionally its contents.

This leverages generated mocks using mockery and testify/mock to make
testing easier.
@stevenh stevenh requested a review from a team as a code owner August 12, 2024 22:24
Copy link

netlify bot commented Aug 12, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit bb47f68
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66d6bc97076506000844e5aa
😎 Deploy Preview https://deploy-preview-2731--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.

@stevenh
Copy link
Collaborator Author

stevenh commented Aug 12, 2024

This can be used to fix the circular dependency between the wait and ready conditions in elasticsearch as flagged on #272 as a missing test by turning the ready condition into a wait for the file exists condition.

@stevenh stevenh force-pushed the feat/wait-file branch 8 times, most recently from 6127f6f to a121980 Compare August 14, 2024 08:49
Add output of the docker config if we hit rate limiting to aid in
debugging why this is happening on github actions.

Don't use logger as that's no-op when verbose is not in effect.
@mdelapenya mdelapenya self-assigned this Aug 16, 2024
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Aug 16, 2024
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

@stevenh this LGTM, thanks! I added a commit listing the new wait strategy in the different pages. PTAL at bb47f68 to verify my changes.

Also, here they are the rendered URL for the changes:

@mdelapenya
Copy link
Member

One additional (non-blocking) thing regarding this: can you share your own need for adding this wait strategy? I'm interested in learning more about how it's used in the wild

@stevenh
Copy link
Collaborator Author

stevenh commented Sep 3, 2024

@stevenh this LGTM, thanks! I added a commit listing the new wait strategy in the different pages. PTAL at bb47f68 to verify my changes.

Also, here they are the rendered URL for the changes:

Thanks for the info, appreciated.

Is there any way we could catch this in CI?

@stevenh
Copy link
Collaborator Author

stevenh commented Sep 3, 2024

One additional (non-blocking) thing regarding this: can you share your own need for adding this wait strategy? I'm interested in learning more about how it's used in the wild

Yep, there's already requirement for it in this PR

@mdelapenya
Copy link
Member

Is there any way we could catch this in CI?

Not at the moment, and I think it would need the creation of custom automation for the validation, so not easy nor straight forward (I'm not aware of a tool that allows to detect this kind of things, but wishing it existed)

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdelapenya mdelapenya merged commit cf51ec7 into testcontainers:main Sep 3, 2024
112 checks passed
mdelapenya added a commit that referenced this pull request Sep 3, 2024
* main:
  feat(wait): for file (#2731)
  feat(compose): select services via profiles (#2758)
  chore(deps): bump mkdocs-markdownextradata-plugin from 0.2.5 to 0.2.6 (#2761)
  fix: update template too (#2763)
  chore(deps): bump actions/checkout from 4.1.1 to 4.1.7 (#2762)
  chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.2.2 (#2760)
  fix: check if the discovered docker socket responds (#2741)
  Upgrade milvus-io/milvus-sdk-go to avoid checksum mismatch. (#2753)
  Fix trailing slash on Image Prefix (#2747)
  chore: use new testcontainers/ryuk:0.9.0 image (#2750)
  chore(deps): bump minimal Go version from 1.21 to 1.22 (#2743)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Sep 9, 2024
* main:
  docs: refine heading badges in README (testcontainers#2770)
  feat(wait): for file (testcontainers#2731)
  feat(compose): select services via profiles (testcontainers#2758)
  chore(deps): bump mkdocs-markdownextradata-plugin from 0.2.5 to 0.2.6 (testcontainers#2761)
  fix: update template too (testcontainers#2763)
  chore(deps): bump actions/checkout from 4.1.1 to 4.1.7 (testcontainers#2762)
  chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.2.2 (testcontainers#2760)
  fix: check if the discovered docker socket responds (testcontainers#2741)
  Upgrade milvus-io/milvus-sdk-go to avoid checksum mismatch. (testcontainers#2753)
  Fix trailing slash on Image Prefix (testcontainers#2747)
  chore: use new testcontainers/ryuk:0.9.0 image (testcontainers#2750)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Sep 11, 2024
* main:
  ci: add generate for mocks (testcontainers#2774)
  fix: docker config error handling when config file does not exist (testcontainers#2772)
  docs: refine heading badges in README (testcontainers#2770)
  feat(wait): for file (testcontainers#2731)
  feat(compose): select services via profiles (testcontainers#2758)
  chore(deps): bump mkdocs-markdownextradata-plugin from 0.2.5 to 0.2.6 (testcontainers#2761)
  fix: update template too (testcontainers#2763)
  chore(deps): bump actions/checkout from 4.1.1 to 4.1.7 (testcontainers#2762)
  chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.2.2 (testcontainers#2760)
  fix: check if the discovered docker socket responds (testcontainers#2741)
  Upgrade milvus-io/milvus-sdk-go to avoid checksum mismatch. (testcontainers#2753)
  Fix trailing slash on Image Prefix (testcontainers#2747)
  chore: use new testcontainers/ryuk:0.9.0 image (testcontainers#2750)
mdelapenya added a commit that referenced this pull request Sep 26, 2024
* main: (29 commits)
  fix: template for code generation (#2800)
  fix: update module path (#2797)
  fix: container logging deadlocks (#2791)
  chore: use a much smaller image for testing (#2795)
  fix: parallel containers clean race (#2790)
  fix(registry): wait for (#2793)
  fix: container timeout test (#2792)
  docs: document redpanda options (#2789)
  feat: support databend module (#2779)
  chore: golangci-lint 1.61.0 (#2787)
  fix(mssql): bump Docker image version (#2786)
  fix: handle 127 error code for podman compatibility (#2778)
  fix: do not override ImageBuildOptions.Labels when building from a Dockerfile (#2775)
  feat(mongodb): Wait for mongodb module with a replicaset to finish (#2777)
  fix(postgres): Apply default snapshot name if no name specified (#2783)
  fix: resource clean up for tests and examples (#2738)
  ci: add generate for mocks (#2774)
  fix: docker config error handling when config file does not exist (#2772)
  docs: refine heading badges in README (#2770)
  feat(wait): for file (#2731)
  ...
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

Successfully merging this pull request may close these issues.

2 participants