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

break: disable reaper at config level #941

Merged
merged 37 commits into from
Mar 20, 2023

Conversation

mdelapenya
Copy link
Collaborator

What does this PR do?

This PR removes the ability to skip the reaper for a container, delegating that reponsability to the entire execution: all containers or none.

For that, we had to cause a breaking change with the NewDockerClient method, as it was returning too many things. Instead, we are removing from the return signature the Testcontainers configuration and the current Docker Host.

To compensate that, we are exposing a ReadConfig method that provides the same information, as the config properties file contains information about the host.

As part of the refactor, we are initialising the config just once, using the sync package, and displaying the existing reaper banner only at that time. This banner is a warning that is shown when the reaper is disabled.

In this PR we are adding a GH workflow to run the tests without the reaper.

Why is it important?

First, it's about project organisation and code responsibility: obtaining a Docker client from TC was doing too many things, and now it's possible to extract that information with different methods.

Second, we are deprecating the usage of the req.SkipReaper attribute from the container request struct, as we consider it weird to enable/diable the reaper per container, instead of per test execution, which is what this PR is proposing.

Related issues

@mdelapenya mdelapenya added the breaking change Causing compatibility issues. label Mar 15, 2023
@mdelapenya mdelapenya self-assigned this Mar 15, 2023
@netlify
Copy link

netlify bot commented Mar 15, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit ee9a640
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/641887789acb2e0008d5b92d
😎 Deploy Preview https://deploy-preview-941--testcontainers-go.netlify.app/features/configuration
📱 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 settings.

@mdelapenya mdelapenya marked this pull request as ready for review March 17, 2023 08:48
@mdelapenya mdelapenya requested a review from a team as a code owner March 17, 2023 08:48
@sonarcloud
Copy link

sonarcloud bot commented Mar 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.0% 1.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Causing compatibility issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant