-
Notifications
You must be signed in to change notification settings - Fork 460
Shared mini test suite #5536
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
Shared mini test suite #5536
Conversation
All ITs that extend SharedMiniClusterBase, but start it without the callback parameter can likely be run together. This commit creates a new class, SimpleSharedMacTestSuite, which will set up the shared MiniAccumuloCluster before running all tests that have the SIMPLE_MINI_CLUSTER_ONLY tag, and then shut the cluster down.
Testing locally using
and
It looks like the ITs that are run as part of the suite are being run again in the second IT run that is meant to exclude them. Need to continue debugging that. |
@keith-turner @kevinrr888 - the tests in the comment above are consistently failing for me locally with the same error. The change here is that these tests are being run in a MiniAccumuloCluster instance that is much longer lived with other tests happening before the tests that are failing. |
The change in 2efdef7 seems to resolve the tests being run twice. I think I have this where I want it now. I'm going to kick off a full build to see if it sped things up. |
Removing the IT suffix should prevent the suite from getting picked up in the second failsafe execution. The excludedGroup tag was not working for some reason.
Full IT build successful. Compared the most recent 4.0 full build:
It's interesting that |
test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as Christopher is good with the build changes, I think this is good to go!
I am working on getting this to work for the ITs that set a custom config. Was originally considering just putting that PR up against this branch, but now thinking it will be better suited as a standalone PR after this is merged in (easier for others to review and won't hold up this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the all-or-nothing approach to the tests in the suite, but if it saves a lot of time in the normal case, it's probably worth it. What happens when you run an individual test in the suite in the IDE? Does it still work correctly? Or do you have to run the suite test and see the output of all the tests in the suite?
Also, I'm not a fan of the fact that it seems to run every time, even when specifying -Dit.test=
for a specific test. That can be addressed in a profile, as I mentioned in the below comment.
<execution> | ||
<id>run-integration-test-suite</id> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<test>org.apache.accumulo.suites.SimpleSharedMacTestSuite</test> | ||
</configuration> | ||
</execution> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this overwrites the user's -Dit.test=
selection, and will always run, regardless of which tests the user specifies. I'm not sure a good workaround for that, except maybe put this execution in a profile that is activated when that test variable is not provided, as in <property>!it.test</property>
. In that case, it would also be skipped when it.test
is used to specify one of the tests in the suite itself, so it's not a perfect solution, but it's probably better to suppress the execution when the user wants to run an explicit test.
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-suite-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-suite-engine</artifactId> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these compile time dependencies or runtime dependencies? It seems like maybe the engine is a runtime dependency. It probably should have a runtime scope.
Running a single test that is part of the suite on it's own should still work. |
Okay, good to know! |
- Noticed several SharedMiniClusterBase ITs were not calling `stopMiniCluster()`. All tests which start a mini cluster now stop the mini cluster as well. - Added some javadoc changes to SharedMiniClusterBase and SimpleSharedMacTestSuite - Misc. other minor changes
- Noticed several SharedMiniClusterBase ITs were not calling `stopMiniCluster()`. All tests which start a mini cluster now stop the mini cluster as well. - Added some javadoc changes to SharedMiniClusterBase and SimpleSharedMacTestSuite - Misc. other minor changes
* Minor follow on to #5536 - Noticed several SharedMiniClusterBase ITs were not calling `stopMiniCluster()`. All tests which start a mini cluster now stop the mini cluster as well. - Added some javadoc changes to SharedMiniClusterBase and SimpleSharedMacTestSuite - Small typo fixes - Changed junit-platform-suite-engine dependency in test/pom.xml from being compile scope to being test scope
Created SimpleSharedMacTestSuiteIT which starts Mini, runs all of the tests with
the SIMPLE_MINI_CLUSTER_SUITE tag, then shuts down Mini. Annotated most of
the tests that extended SharedMiniClusterBase and called startMiniCluster with
no configuration callback with the SIMPLE_MINI_CLUSTER_SUITE tag. These test
with that did not use a configuration callback where most likely to not do
destructive things with Mini. ManagerApiIT was one exception and I did not put
the tag on this class.
Modified SharedMiniClusterBase so that stopMiniCluster would not stop the
cluster if STOP_DISABLED was set to true, which it is in the new test suite class.
This enables a single test class to be run and behave normally, but also allows
the class to be part of the test suite and not shut down Mini after the tests have
run. Modified stopMiniCluster to instead delete all user tables when STOP_DISABLED
is set to true to clean up tables from the test class. Leaving the tables around
in the instance worked for most tests, but not for tests that counted tables
and expected a certain number (CreateTableIT) or for tests that kicked off a compaction
and waited for it to finish (ComprehensiveIT.testCompaction) as the single
Compactor may have been busy compacting other tables.
Modified the pom to have two failsafe executions, one for the ITs without the
SIMPLE_MINI_CLUSTER_SUITE and one for the test suite.
Closes #5529