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

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

Merged

Conversation

jasonyunicorn
Copy link
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

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

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.

@jasonyunicorn jasonyunicorn 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
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!

testing.go Outdated Show resolved Hide resolved
testing.go Show resolved Hide resolved
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
@jasonyunicorn jasonyunicorn force-pushed the jasonyunicorn/chore-2859 branch from aaa2733 to cb5e5dc Compare January 13, 2025 22:17
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 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
124 checks passed
@jasonyunicorn jasonyunicorn deleted the jasonyunicorn/chore-2859 branch January 14, 2025 17:36
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
3 participants