-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
From what I can see, only the FQCN of the test resource lifecycle manager and the configured scope are taken into account when grouping together tests with matching resources:
quarkus/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java
Lines 321 to 332 in 2fc4833
public static Set<TestResourceManager.TestResourceComparisonInfo> testResourceComparisonInfo(Class<?> testClass, | |
Path testClassLocation) { | |
Set<TestResourceClassEntry> uniqueEntries = getUniqueTestResourceClassEntries(testClass, testClassLocation, null); | |
if (uniqueEntries.isEmpty()) { | |
return Collections.emptySet(); | |
} | |
Set<TestResourceManager.TestResourceComparisonInfo> result = new HashSet<>(uniqueEntries.size()); | |
for (TestResourceClassEntry entry : uniqueEntries) { | |
result.add(new TestResourceComparisonInfo(entry.testResourceLifecycleManagerClass().getName(), entry.getScope())); | |
} | |
return result; | |
} |
This seems incomplete, as test resource lifecycle managers can implement QuarkusTestResourceConfigurableLifecycleManager
to be customized per-test, like this:
Expected behavior
Tests are considered to have matching resources if they have the same resource lifecycle managers with the same arguments.
Actual behavior
Tests are considered to have matching resources if they have the same resource lifecycle managers, regardless of arguments.
How to Reproduce?
Check out quarkusio/search.quarkus.io#345 , revert the last commit, and see how resources are reused despite the
Or, probably simpler, add a unit test next to the existing ones for @WithTestResource
within Quarkus itself.
Output of uname -a
or ver
No response
Output of java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
Related conversation: quarkusio/search.quarkus.io#345
PR introducing the feature: #42852