Skip to content

Commit

Permalink
Handle @nested with continuous testing
Browse files Browse the repository at this point in the history
Fixes quarkusio#23075

(cherry picked from commit a464e10)
  • Loading branch information
stuartwdouglas authored and gsmet committed Jan 25, 2022
1 parent 4f7b1ea commit ea55d14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.jboss.jandex.Index;
import org.jboss.jandex.Indexer;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Tags;
Expand Down Expand Up @@ -90,6 +91,7 @@ public class JunitTestRunner {
public static final DotName TEST_FACTORY = DotName.createSimple(TestFactory.class.getName());
public static final DotName TEST_TEMPLATE = DotName.createSimple(TestTemplate.class.getName());
public static final DotName TESTABLE = DotName.createSimple(Testable.class.getName());
public static final DotName NESTED = DotName.createSimple(Nested.class.getName());
private final long runId;
private final DevModeContext.ModuleInfo moduleInfo;
private final DevModeContext devModeContext;
Expand Down Expand Up @@ -542,10 +544,18 @@ private DiscoveryResult discoverTestClasses() {
}
Set<DotName> allTestAnnotations = collectTestAnnotations(index);
Set<DotName> allTestClasses = new HashSet<>();
Map<DotName, DotName> enclosingClasses = new HashMap<>();
for (DotName annotation : allTestAnnotations) {
for (AnnotationInstance instance : index.getAnnotations(annotation)) {
if (instance.target().kind() == AnnotationTarget.Kind.METHOD) {
allTestClasses.add(instance.target().asMethod().declaringClass().name());
ClassInfo classInfo = instance.target().asMethod().declaringClass();
allTestClasses.add(classInfo.name());
if (classInfo.classAnnotation(NESTED) != null) {
var enclosing = classInfo.enclosingClass();
if (enclosing != null) {
enclosingClasses.put(classInfo.name(), enclosing);
}
}
}
}
}
Expand All @@ -557,6 +567,16 @@ private DiscoveryResult discoverTestClasses() {
if (integrationTestClasses.contains(name) || quarkusTestClasses.contains(name)) {
continue;
}
var enclosing = enclosingClasses.get(testClass);
if (enclosing != null) {
if (integrationTestClasses.contains(enclosing.toString())) {
integrationTestClasses.add(name);
continue;
} else if (quarkusTestClasses.contains(enclosing.toString())) {
quarkusTestClasses.add(name);
continue;
}
}
ClassInfo clazz = index.getClassByName(testClass);
if (Modifier.isAbstract(clazz.flags())) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ openssl req -x509 -new -newkey rsa:2048 -nodes -keyout ca.key -out ca.pem \
-config ca-openssl.cnf -days 3650 -extensions v3_req
```


When prompted for certificate information, everything is default.

Client is issued by CA:
Expand Down

0 comments on commit ea55d14

Please sign in to comment.