From 42cfd79ab7e923597540827d905591f4121542c4 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 --- .../quarkus/deployment/dev/testing/TestClassUsages.java | 9 ++++++++- 1 file changed, 8 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 61984322831c64..dc9a62dabe4754 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,20 @@ 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) {