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

stop database containers when spock execution ends #2843

Merged
merged 1 commit into from
May 12, 2022

Conversation

StevenMassaro
Copy link
Contributor

Environment

Liquibase Version: N/A

Liquibase Integration & Version: integration test framework

Liquibase Extension(s) & Version: N/A

Database Vendor & Version: N/A

Operating System Type & Version: N/A

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The existing integration test framework was configured to stop TestSystem's when the cleanup: method was called. Spock internally called this method when it finished executing all of the tests in a class. Thus, when a particular test class was completed, its TestSystem was stopped, which in some cases was premature, since other classes might use the same TestSystem.

Instead, the TestSystem's should be stopped when Spock finishes executing all of the tests in all classes.

Steps To Reproduce

Create two test classes, both which use the same TestSystem. Run both (through maven, or through Intellij in the same run configuration), and observe that the first test passes and the second test fails with a message indicating that the container has already been shut down.

Actual Behavior

The second test fails with a message indicating that the container has already been shut down.

Expected/Desired Behavior

The second test succeeds using the same TestSystem and the containers are stopped when all tests finish executing.

Screenshots (if appropriate)

Additional Context

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us in the Liquibase Forum.

@StevenMassaro StevenMassaro merged commit d2bea1a into master May 12, 2022
@StevenMassaro StevenMassaro deleted the test-framework-stop-containers branch May 12, 2022 18:05
StevenMassaro added a commit that referenced this pull request May 12, 2022
The existing integration test framework was configured to stop TestSystem's when the cleanup: method was called. Spock internally called this method when it finished executing all of the tests in a class. Thus, when a particular test class was completed, its TestSystem was stopped, which in some cases was premature, since other classes might use the same TestSystem.

Instead, the TestSystem's should be stopped when Spock finishes executing all of the tests in all classes.

(cherry picked from commit d2bea1a)
StevenMassaro added a commit that referenced this pull request May 12, 2022
The existing integration test framework was configured to stop TestSystem's when the cleanup: method was called. Spock internally called this method when it finished executing all of the tests in a class. Thus, when a particular test class was completed, its TestSystem was stopped, which in some cases was premature, since other classes might use the same TestSystem.

Instead, the TestSystem's should be stopped when Spock finishes executing all of the tests in all classes.

(cherry picked from commit d2bea1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants