Skip to content

chore: recover from panic in SkipIfProviderIsNotHealthy test helper function#2939

Merged
mdelapenya merged 5 commits intotestcontainers:mainfrom
youshibin:jasonyunicorn/chore-2859
Jan 14, 2025
Merged

chore: recover from panic in SkipIfProviderIsNotHealthy test helper function#2939
mdelapenya merged 5 commits intotestcontainers:mainfrom
youshibin:jasonyunicorn/chore-2859

Conversation

@youshibin
Copy link
Copy Markdown
Contributor

What does this PR do?

Recovers from panic (in a defer statement) and skips the tests if necessary.

Why is it important?

Attempting to skip tests on runners where Docker is not usable using github.com/testcontainers/testcontainers-go.SkipIfProviderIsNotHealthy is still failing unconditionally.

Related issues

Closes #2859

How to test this PR

Run the tests in CI/CD for macos-latest runners in GitHub Actions and observe if there any still any panics.

Follow-ups

@youshibin youshibin requested a review from a team as a code owner January 10, 2025 18:05
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 10, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit cb5e5dc
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/678591102fb13e000835bc8c
😎 Deploy Preview https://deploy-preview-2939--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.

@youshibin youshibin changed the title chore: Recover from panic in SkipIfProviderIsNotHealthy test helper function chore: recover from panic in SkipIfProviderIsNotHealthy test helper function Jan 10, 2025
mdelapenya
mdelapenya previously approved these changes Jan 13, 2025
Copy link
Copy Markdown
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, just suggesting fixing an existing typo.

Thanks!

Co-authored-by: Manuel de la Peña <[email protected]>
    * Move t.Helper before defer
    * Include value of r in skip statement
    * Fix more typos
@youshibin youshibin force-pushed the jasonyunicorn/chore-2859 branch from aaa2733 to cb5e5dc Compare January 13, 2025 22:17
Copy link
Copy Markdown
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 self-assigned this Jan 14, 2025
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Jan 14, 2025
@mdelapenya mdelapenya merged commit 09dd613 into testcontainers:main Jan 14, 2025
@youshibin youshibin deleted the jasonyunicorn/chore-2859 branch January 14, 2025 17:36
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Feb 3, 2025
* main: (29 commits)
  deps(fix): include modulegen templates dir in dependabot updates (testcontainers#2956)
  chore(deps): bump docker/setup-docker-action from 4.0.0 to 4.1.0 (testcontainers#2959)
  feat: adds Pinecone module (testcontainers#2955)
  chore(deps): bump actions/setup-go from 5.1.0 to 5.3.0 (testcontainers#2957)
  chore(deps): bump actions/upload-artifact from 4.4.3 to 4.6.0 (testcontainers#2958)
  chore: enable unused-parameter from revive (testcontainers#2949)
  chore: enable use-any from revive (testcontainers#2948)
  bump golangci-lint to v1.63.4 (testcontainers#2950)
  chore: enable var-declaration from revive linter (testcontainers#2942)
  chore: enable context-as-argument from revive linter (testcontainers#2946)
  chore: enable early-return, indent-error-flow and superfluous-else from revive linter (testcontainers#2947)
  chore!: rename EnpointSettingsModifier to EndpointSettingsModifier
  fix(localstack): more reliable legacy tag detection (testcontainers#2936)
  chore: recover from panic in `SkipIfProviderIsNotHealthy` test helper function (testcontainers#2939)
  chore: fix typos (testcontainers#2940)
  deps(compose): bump compose (v2.32.2) and compose-go spec (v2.4.7) (testcontainers#2938)
  chore: prepare for next minor development cycle (0.36.0)
  chore: use new version (v0.35.0) in modules and examples
  feat(postgres): ssl for postgres (testcontainers#2473)
  feat(ollama): support calling the Ollama local process (testcontainers#2923)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: github.com/testcontainers/testcontainers-go.SkipIfProviderIsNotHealthy panics on GHA macos-latest runners

3 participants