Skip to content

break: disable reaper at config level#941

Merged
mdelapenya merged 37 commits intotestcontainers:mainfrom
mdelapenya:init-reaper-just-once
Mar 20, 2023
Merged

break: disable reaper at config level#941
mdelapenya merged 37 commits intotestcontainers:mainfrom
mdelapenya:init-reaper-just-once

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

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
Copy Markdown

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
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant