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

Add ability to control which classes are cloned #17306

Merged
merged 1 commit into from
May 20, 2021

Conversation

stuartwdouglas
Copy link
Member

@stuartwdouglas stuartwdouglas commented May 18, 2021

This can interfere with other JUnit exists, such
as Pact.

Fixes #9677

@quarkus-bot
Copy link

quarkus-bot bot commented May 18, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building c9c43dd

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Devtools Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Devtools Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 16 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
MicroProfile TCKs Tests Verify ⚠️ Check → Logs Raw logs
Native Tests - Data1 Build ⚠️ Check → Logs Raw logs
Native Tests - Data2 Build ⚠️ Check → Logs Raw logs
Native Tests - Data5 Build ⚠️ Check → Logs Raw logs
Native Tests - Main Build ⚠️ Check → Logs Raw logs
Native Tests - Messaging1 Build ⚠️ Check → Logs Raw logs
Native Tests - Security3 Build ⚠️ Check → Logs Raw logs
Native Tests - Spring Build ⚠️ Check → Logs Raw logs
Native Tests - Windows - hibernate-validator Build ⚠️ Check → Logs Raw logs

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a few typos and asked a question.

@@ -152,6 +152,16 @@
@ConfigItem(defaultValue = "all")
TestType type;

/**
* If a class matches this pattern then it wil be cloned into the Quarkus ClassLoader even if it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* If a class matches this pattern then it wil be cloned into the Quarkus ClassLoader even if it
* If a class matches this pattern then it will be cloned into the Quarkus ClassLoader even if it

@@ -152,6 +152,16 @@
@ConfigItem(defaultValue = "all")
TestType type;

/**
* If a class matches this pattern then it wil be cloned into the Quarkus ClassLoader even if it
* is a parent first artifact.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* is a parent first artifact.
* is in a parent first artifact.

@@ -950,8 +951,16 @@ private Object runExtensionMethod(ReflectiveInvocationContext<Method> invocation
// because the test method runs from a class loaded from the TCCL
List<Object> originalArguments = invocationContext.getArguments();
List<Object> argumentsFromTccl = new ArrayList<>();
String patternString = runningQuarkusApplication.getConfigValue("quarkus.test.class-clone-pattern", String.class)
.orElse("java.*");
Pattern clonePattern = Pattern.compile(patternString);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should rather compile the pattern once globally rather than for each method?

@quarkus-bot
Copy link

quarkus-bot bot commented May 18, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 8c9687b

Status Name Step Test failures Logs Raw logs
JVM Tests - JDK 11 Build Test failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
JVM Tests - JDK 16 Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimentionsIntArrayArgument(int[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimensionsStringArrayArgument(String[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimensionStringArrayArgument(String[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimentionsIntArrayArgument(int[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimensionsStringArrayArgument(String[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimentionIntArrayArgument(int[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedSimpleTestCase.nullArgument(String)[1] - More details - Source on GitHub


⚙️ JVM Tests - JDK 11 Windows #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimentionsIntArrayArgument(int[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimensionsStringArrayArgument(String[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimensionStringArrayArgument(String[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimentionsIntArrayArgument(int[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimensionsStringArrayArgument(String[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimentionIntArrayArgument(int[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedSimpleTestCase.nullArgument(String)[1] - More details - Source on GitHub


⚙️ JVM Tests - JDK 16 #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimentionsIntArrayArgument(int[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.twoDimensionsStringArrayArgument(String[][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimensionStringArrayArgument(String[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimentionsIntArrayArgument(int[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.threeDimensionsStringArrayArgument(String[][][])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedArrayTestCase.oneDimentionIntArrayArgument(int[])[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedSimpleTestCase.nullArgument(String)[1] - More details - Source on GitHub

@stuartwdouglas stuartwdouglas force-pushed the fine-grained-cloning branch 2 times, most recently from e1431d1 to d73605c Compare May 19, 2021 05:29
@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building e1431d1

Status Name Step Test failures Logs Raw logs
JVM Tests - JDK 11 Build Test failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
JVM Tests - JDK 16 Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub


⚙️ JVM Tests - JDK 11 Windows #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub


⚙️ JVM Tests - JDK 16 #

📦 integration-tests/main

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[1] - More details - Source on GitHub

io.quarkus.it.main.MethodSourceTest.testParameterResolver(DummyInput, Matcher)[2] - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testSerializableParameterResolver(ParameterResolverTest$SomeSerializable) - More details - Source on GitHub

io.quarkus.it.main.ParameterResolverTest.testParameterResolver(UnusedBean$DummyInput,Supplier) - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[1] - More details - Source on GitHub

io.quarkus.it.main.ParameterizedEnumTestCase.testHelloEndpoint(MyEnum)[2] - More details - Source on GitHub

* This is important for collections which can contain objects from the Quarkus ClassLoader, but for
* most parent first classes it will just cause problems.
*/
@ConfigItem(defaultValue = "java.*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartwdouglas sorry to raise this question so late but shouldn't it be java\..*? Because with this, you also catch the Bean Validation classes starting with javax. for instance and anything starting with java at large.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.

@@ -343,6 +346,9 @@ private ExtensionState doJavaStart(ExtensionContext context, Class<? extends Qua
populateCallbacks(startupAction.getClassLoader());

runningQuarkusApplication = startupAction.run();
String patternString = runningQuarkusApplication.getConfigValue("quarkus.test.class-clone-pattern", String.class)
.orElse("java.*");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pattern should also be adjusted here if we change it.

This can interfere with other JUnit exists, such
as Pact.

Also make Pact parent first.

Fixes quarkusio#9677
@stuartwdouglas stuartwdouglas force-pushed the fine-grained-cloning branch from d73605c to 9102276 Compare May 19, 2021 21:24
@gsmet gsmet merged commit 57da473 into quarkusio:main May 20, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 20, 2021
@gsmet
Copy link
Member

gsmet commented May 20, 2021

This one is not backportable as is, it's just one big conflict. If really necessary, we need a specific PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConversionException/NPE in @QuarkusTest and using Pact-JVM Jupiter Provider
3 participants