From bf4f2b4d06c773077415bed3ada553c317966c5a Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 2 May 2023 21:40:39 +1000 Subject: [PATCH] Include classes touched by parent for testing When deciding if a test should be re-run we should also re-run the test if class level methods touched the changed class. Fixes #27821 --- .../deployment/dev/testing/TestClassUsages.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestClassUsages.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestClassUsages.java index 61984322831c6..cf55db3d21bce 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestClassUsages.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestClassUsages.java @@ -18,13 +18,21 @@ public class TestClassUsages implements Serializable { private final Map> classNames = new HashMap<>(); + private final Map> classLevel = new HashMap<>(); + public synchronized void updateTestData(String currentclass, UniqueId test, Set touched) { - classNames.put(new ClassAndMethod(currentclass, test), touched); + Set aggregate = touched; + var extra = classLevel.get(currentclass); + if (extra != null) { + aggregate.addAll(extra); + } + classNames.put(new ClassAndMethod(currentclass, test), aggregate); } public synchronized void updateTestData(String currentclass, Set touched) { classNames.put(new ClassAndMethod(currentclass, null), touched); + classLevel.put(currentclass, touched); } public synchronized void merge(TestClassUsages newData) {