From 04782baa6ef6e63831b1ebcb79fbf8d0342036cb Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:35:44 +0200 Subject: [PATCH 01/62] Add GH Actions workflow to post-process and validate closed issues --- ...sue-labels.yml => label-opened-issues.yml} | 2 +- .github/workflows/unlabel-closed-issues.yml | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) rename .github/workflows/{issue-labels.yml => label-opened-issues.yml} (92%) create mode 100644 .github/workflows/unlabel-closed-issues.yml diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/label-opened-issues.yml similarity index 92% rename from .github/workflows/issue-labels.yml rename to .github/workflows/label-opened-issues.yml index b91cf84c462b..066596b43c85 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/label-opened-issues.yml @@ -1,4 +1,4 @@ -name: Label new issues +name: Add label to opened issues on: issues: types: diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml new file mode 100644 index 000000000000..ff96f0a70468 --- /dev/null +++ b/.github/workflows/unlabel-closed-issues.yml @@ -0,0 +1,39 @@ +name: Remove label from closed issues +on: + issues: + types: + - closed +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/github-script@v7 + with: + script: | + const originalLabels = context.issue.labels.map(l => l.name); + const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); + if (newLabels.length !== originalLabels.length) { + github.rest.issues.update({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: newLabels, + }); + } + const statusLabels = newLabels.filter(l => l.startsWith("status: ")); + if (context.issue.state_reason === "not planned" && statusLabels.length === 0) { + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Please assign a status label to this issue.", + }); + github.rest.issues.update({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + state: "open", + }); + } From a885b34a4d75da5dac59fdd6be2abc82a3caf0a5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:40:48 +0200 Subject: [PATCH 02/62] Add debug output --- .github/workflows/unlabel-closed-issues.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index ff96f0a70468..a2f8b0d0a036 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -12,8 +12,11 @@ jobs: - uses: actions/github-script@v7 with: script: | + console.log(context.issue); const originalLabels = context.issue.labels.map(l => l.name); + console.log(originalLabels); const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); + console.log(newLabels); if (newLabels.length !== originalLabels.length) { github.rest.issues.update({ issue_number: context.issue.number, @@ -23,6 +26,7 @@ jobs: }); } const statusLabels = newLabels.filter(l => l.startsWith("status: ")); + console.log(statusLabels); if (context.issue.state_reason === "not planned" && statusLabels.length === 0) { github.rest.issues.createComment({ issue_number: context.issue.number, From 09a86a077f7162c3103476f11adbe175291cdca1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:44:26 +0200 Subject: [PATCH 03/62] Load issue via API --- .github/workflows/unlabel-closed-issues.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index a2f8b0d0a036..68484849289c 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -12,14 +12,19 @@ jobs: - uses: actions/github-script@v7 with: script: | - console.log(context.issue); - const originalLabels = context.issue.labels.map(l => l.name); + const issue = github.rest.issues.get({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + }); + console.log(issue); + const originalLabels = issue.labels.map(l => l.name); console.log(originalLabels); const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); console.log(newLabels); if (newLabels.length !== originalLabels.length) { github.rest.issues.update({ - issue_number: context.issue.number, + issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, labels: newLabels, @@ -27,15 +32,15 @@ jobs: } const statusLabels = newLabels.filter(l => l.startsWith("status: ")); console.log(statusLabels); - if (context.issue.state_reason === "not planned" && statusLabels.length === 0) { + if (issue.state_reason === "not planned" && statusLabels.length === 0) { github.rest.issues.createComment({ - issue_number: context.issue.number, + issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, body: "Please assign a status label to this issue.", }); github.rest.issues.update({ - issue_number: context.issue.number, + issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, state: "open", From 4130b4cb5ca4a788702da51d1b5bd1892bdab3c0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:45:51 +0200 Subject: [PATCH 04/62] Await Promise --- .github/workflows/unlabel-closed-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index 68484849289c..7514e08332ff 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/github-script@v7 with: script: | - const issue = github.rest.issues.get({ + const issue = await github.rest.issues.get({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, From 5f050fe09af001cd81638d369cb5c210695419c6 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:50:30 +0200 Subject: [PATCH 05/62] Access nested data --- .github/workflows/unlabel-closed-issues.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index 7514e08332ff..3deb1d950331 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -17,14 +17,14 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - console.log(issue); - const originalLabels = issue.labels.map(l => l.name); + console.log(issue.data); + const originalLabels = issue.data.labels.map(l => l.name); console.log(originalLabels); const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); console.log(newLabels); if (newLabels.length !== originalLabels.length) { github.rest.issues.update({ - issue_number: issue.number, + issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, labels: newLabels, @@ -32,15 +32,15 @@ jobs: } const statusLabels = newLabels.filter(l => l.startsWith("status: ")); console.log(statusLabels); - if (issue.state_reason === "not planned" && statusLabels.length === 0) { + if (issue.data.state_reason === "not_planned" && statusLabels.length === 0) { github.rest.issues.createComment({ - issue_number: issue.number, + issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Please assign a status label to this issue.", + body: "Please assign a status label to this issue.data.", }); github.rest.issues.update({ - issue_number: issue.number, + issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, state: "open", From 94b4b8642d3d3e4897b27bd1af637c17ea4d047f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:52:47 +0200 Subject: [PATCH 06/62] Remove debug output --- .github/workflows/unlabel-closed-issues.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index 3deb1d950331..2bc4278b921a 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -17,11 +17,8 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - console.log(issue.data); const originalLabels = issue.data.labels.map(l => l.name); - console.log(originalLabels); const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); - console.log(newLabels); if (newLabels.length !== originalLabels.length) { github.rest.issues.update({ issue_number: issue.data.number, @@ -31,13 +28,12 @@ jobs: }); } const statusLabels = newLabels.filter(l => l.startsWith("status: ")); - console.log(statusLabels); if (issue.data.state_reason === "not_planned" && statusLabels.length === 0) { github.rest.issues.createComment({ issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Please assign a status label to this issue.data.", + body: "Please assign a status label to this issue.", }); github.rest.issues.update({ issue_number: issue.data.number, From 0a68fc41b6ad0bf92d20035b2d7cbf2cca017a84 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:55:06 +0200 Subject: [PATCH 07/62] Await all requests --- .github/workflows/unlabel-closed-issues.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index 2bc4278b921a..2554569d6679 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -20,7 +20,7 @@ jobs: const originalLabels = issue.data.labels.map(l => l.name); const newLabels = originalLabels.filter(l => l !== "status: in progress" && l !== "status: new"); if (newLabels.length !== originalLabels.length) { - github.rest.issues.update({ + await github.rest.issues.update({ issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, @@ -29,13 +29,13 @@ jobs: } const statusLabels = newLabels.filter(l => l.startsWith("status: ")); if (issue.data.state_reason === "not_planned" && statusLabels.length === 0) { - github.rest.issues.createComment({ + await github.rest.issues.createComment({ issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, body: "Please assign a status label to this issue.", }); - github.rest.issues.update({ + await github.rest.issues.update({ issue_number: issue.data.number, owner: context.repo.owner, repo: context.repo.repo, From 5f9eeb714637ab641a13ff92fb840c6479b39690 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 1 Sep 2024 12:58:10 +0200 Subject: [PATCH 08/62] Make workflow name clearer --- .github/workflows/unlabel-closed-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index 2554569d6679..cc476e4fccba 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -1,4 +1,4 @@ -name: Remove label from closed issues +name: Check/remove status labels from closed issues on: issues: types: From 751467c6612fedab86433b9225d69140b1057a55 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:08:24 +0200 Subject: [PATCH 09/62] Polish Javadoc and formatting --- .../commons/util/ReflectionUtils.java | 9 +++--- .../platform/commons/util/StringUtils.java | 11 +++---- .../console/options/SelectorConverter.java | 3 -- .../platform/engine/DiscoverySelector.java | 12 +++++--- .../engine/DiscoverySelectorIdentifier.java | 24 +++++++-------- .../engine/discovery/ClassSelector.java | 2 ++ .../discovery/ClasspathResourceSelector.java | 2 ++ .../discovery/ClasspathRootSelector.java | 2 ++ .../engine/discovery/DirectorySelector.java | 2 ++ .../DiscoverySelectorIdentifierParser.java | 22 +++++++------- .../DiscoverySelectorIdentifierParsers.java | 4 ++- .../engine/discovery/DiscoverySelectors.java | 16 +++++++--- .../engine/discovery/FileSelector.java | 4 ++- .../engine/discovery/IterationSelector.java | 30 +++++++++++-------- .../engine/discovery/MethodSelector.java | 1 + .../engine/discovery/ModuleSelector.java | 2 ++ .../engine/discovery/NestedClassSelector.java | 2 ++ .../discovery/NestedMethodSelector.java | 2 ++ .../engine/discovery/PackageSelector.java | 2 ++ .../engine/discovery/UniqueIdSelector.java | 2 ++ .../engine/discovery/UriSelector.java | 2 ++ 21 files changed, 98 insertions(+), 58 deletions(-) diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java index 517ee073f273..dd18b8d13cd6 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java @@ -933,21 +933,22 @@ public static String getFullyQualifiedMethodName(Class clazz, Method method) */ public static String getFullyQualifiedMethodName(Class clazz, String methodName, Class... parameterTypes) { Preconditions.notNull(clazz, "Class must not be null"); - Preconditions.notBlank(methodName, "Method name must not be null or blank"); return getFullyQualifiedMethodName(clazz.getName(), methodName, ClassUtils.nullSafeToString(parameterTypes)); } /** * Build the fully qualified method name for the method described by the - * supplied class, method name, and parameter types. + * supplied class name, method name, and parameter types. * *

Note that the class is not necessarily the class in which the method is * declared. * - * @param className the name of the class from which the method should be referenced; never {@code null} + * @param className the name of the class from which the method should be referenced; + * never {@code null} * @param methodName the name of the method; never {@code null} or blank - * @param parameterTypeNames the parameter type names of the method; may be empty but not {@code null} + * @param parameterTypeNames the parameter type names of the method; may be + * empty but not {@code null} * @return fully qualified method name; never {@code null} * @since 1.11 */ diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java index 42dcdeef863b..0b45e4ed637a 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java @@ -306,9 +306,10 @@ private static TwoPartSplitResult splitIntoTwo(String value, int index, int leng public interface TwoPartSplitResult { /** - * Maps the result of splitting a string into two parts or throw an exception. + * Map the result of splitting a string into two parts or throw an exception. * - * @param onePartExceptionCreator the exception creator to use if the string was split into a single part + * @param onePartExceptionCreator the exception creator to use if the string + * was split into a single part * @param twoPartsMapper the mapper to use if the string was split into two parts */ default T mapTwo(Supplier onePartExceptionCreator, @@ -320,7 +321,7 @@ default T mapTwo(Supplier onePartExceptionCreato } /** - * Maps the result of splitting a string into up to two parts. + * Map the result of splitting a string into up to two parts. * * @param onePartMapper the mapper to use if the string was split into a single part * @param twoPartsMapper the mapper to use if the string was split into two parts @@ -340,7 +341,7 @@ private static final class OnePart implements TwoPartSplitResult { @Override public T map(Function onePartMapper, BiFunction twoPartsMapper) { - return onePartMapper.apply(value); + return onePartMapper.apply(this.value); } } @@ -357,7 +358,7 @@ private static final class TwoParts implements TwoPartSplitResult { @Override public T map(Function onePartMapper, BiFunction twoPartsMapper) { - return twoPartsMapper.apply(first, second); + return twoPartsMapper.apply(this.first, this.second); } } diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/SelectorConverter.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/SelectorConverter.java index 3bb444602cb8..7c18320eba67 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/SelectorConverter.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/SelectorConverter.java @@ -93,7 +93,6 @@ public ClasspathResourceSelector convert(String value) { } static class Iteration implements ITypeConverter { - @Override public IterationSelector convert(String value) { DiscoverySelectorIdentifier identifier = DiscoverySelectorIdentifier.create( @@ -101,11 +100,9 @@ public IterationSelector convert(String value) { return (IterationSelector) DiscoverySelectors.parse(identifier) // .orElseThrow(() -> new PreconditionViolationException("Invalid format: Failed to parse selector")); } - } static class Identifier implements ITypeConverter { - @Override public DiscoverySelectorIdentifier convert(String value) { return DiscoverySelectorIdentifier.parse(value); diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java index 342f536ca2ce..d3faa984fd5f 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java @@ -33,12 +33,16 @@ public interface DiscoverySelector { /** * Return the {@linkplain DiscoverySelectorIdentifier identifier} of this * selector. - *

- * The returned identifier has to be parsable by a corresponding + * + *

The returned identifier must be parsable by a corresponding * {@link DiscoverySelectorIdentifierParser}. * - * @return the identifier of this selector or empty if it is not supported; - * never {@code null} + *

The default implementation returns {@link Optional#empty()}. Can be + * overridden by concrete implementations. + * + * @return an {@link Optional} containing the identifier of this selector; + * never {@code null} but potentially empty if the selector does not support + * identifiers * @since 1.11 */ @API(status = EXPERIMENTAL, since = "1.11") diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelectorIdentifier.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelectorIdentifier.java index 4fd926e9b27b..7f4f8e21138f 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelectorIdentifier.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelectorIdentifier.java @@ -20,10 +20,9 @@ import org.junit.platform.commons.util.StringUtils; /** - * Identifier for {@link DiscoverySelector DiscoverySelectors} with a specific - * prefix. - *

- * The {@linkplain #toString() string representation} of an identifier is + * Identifier for a {@link DiscoverySelector} with a specific prefix. + * + *

The {@linkplain #toString() string representation} of an identifier is * intended to be human-readable and is formatted as {@code prefix:value}. * * @since 1.11 @@ -37,7 +36,7 @@ public final class DiscoverySelectorIdentifier { private final String value; /** - * Create a new {@link DiscoverySelectorIdentifier} with the supplied prefix and + * Create a new {@code DiscoverySelectorIdentifier} with the supplied prefix and * value. * * @param prefix the prefix; never {@code null} or blank @@ -51,8 +50,8 @@ public static DiscoverySelectorIdentifier create(String prefix, String value) { * Parse the supplied string representation of a * {@link DiscoverySelectorIdentifier} in the format {@code prefix:value}. * - * @param string the string representation of a {@link DiscoverySelectorIdentifier} - * @return the parsed {@link DiscoverySelectorIdentifier} + * @param string the string representation of a {@code DiscoverySelectorIdentifier} + * @return the parsed {@code DiscoverySelectorIdentifier} * @throws PreconditionViolationException if the supplied string does not * conform to the expected format */ @@ -74,7 +73,7 @@ private DiscoverySelectorIdentifier(String prefix, String value) { * @return the prefix; never {@code null} or blank */ public String getPrefix() { - return prefix; + return this.prefix; } /** @@ -83,7 +82,7 @@ public String getPrefix() { * @return the value; never {@code null} or blank */ public String getValue() { - return value; + return this.value; } @Override @@ -95,12 +94,12 @@ public boolean equals(Object o) { return false; } DiscoverySelectorIdentifier that = (DiscoverySelectorIdentifier) o; - return Objects.equals(prefix, that.prefix) && Objects.equals(value, that.value); + return Objects.equals(this.prefix, that.prefix) && Objects.equals(this.value, that.value); } @Override public int hashCode() { - return Objects.hash(prefix, value); + return Objects.hash(this.prefix, this.value); } /** @@ -109,6 +108,7 @@ public int hashCode() { */ @Override public String toString() { - return String.format("%s:%s", prefix, value); + return String.format("%s:%s", this.prefix, this.value); } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java index a244c23486db..f1dda935b88d 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java @@ -162,5 +162,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectClass(identifier.getValue())); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java index 1a17cda9119b..eb0aff3fda14 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java @@ -142,5 +142,7 @@ public Optional parse(DiscoverySelectorIdentifier ide } // )); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java index 815edd8373ae..7e41b9ba4310 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java @@ -117,5 +117,7 @@ public Optional parse(DiscoverySelectorIdentifier identif Path path = Paths.get(URI.create(identifier.getValue())); return getFirstElement(DiscoverySelectors.selectClasspathRoots(singleton(path))); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java index 976c20ddb695..77a18048dfde 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java @@ -136,5 +136,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectDirectory(identifier.getValue())); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParser.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParser.java index 8570c6d5c3cc..071e6b09263d 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParser.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParser.java @@ -19,10 +19,9 @@ import org.junit.platform.engine.DiscoverySelectorIdentifier; /** - * Parser for {@link DiscoverySelectorIdentifier DiscoverySelectorIdentifiers} - * with a specific prefix. - *

- * Implementations of this interface can be registered using the Java service + * Parser for a {@link DiscoverySelectorIdentifier} with a specific prefix. + * + *

Implementations of this interface can be registered using the Java service * loader mechanism to extend the set of supported prefixes for * {@link DiscoverySelectorIdentifier DiscoverySelectorIdentifiers}. * @@ -33,22 +32,23 @@ public interface DiscoverySelectorIdentifierParser { /** - * Get the prefix that this parser can handle. + * Get the prefix that this parser supports. * - * @return the prefix that this parser can handle; never {@code null} + * @return the prefix that this parser supports; never {@code null} or blank */ String getPrefix(); /** * Parse the supplied {@link DiscoverySelectorIdentifier}. - *

- * The JUnit Platform will only invoke this method if the supplied + * + *

The JUnit Platform will only invoke this method if the supplied * {@link DiscoverySelectorIdentifier} has a prefix that matches the value * returned by {@link #getPrefix()}. * * @param identifier the {@link DiscoverySelectorIdentifier} to parse * @param context the {@link Context} to use for parsing - * @return an {@link Optional} containing the parsed {@link DiscoverySelector}; never {@code null} + * @return an {@link Optional} containing the parsed {@link DiscoverySelector}; + * never {@code null} but potentially empty */ Optional parse(DiscoverySelectorIdentifier identifier, Context context); @@ -59,8 +59,8 @@ interface Context { /** * Parse the supplied selector. - *

- * This method is intended to be used by implementations of + * + *

This method is intended to be used by implementations of * {@link DiscoverySelectorIdentifierParser#parse} for selectors that * contain other selectors. */ diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParsers.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParsers.java index 2f0d79b46735..7d379a4fce52 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParsers.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParsers.java @@ -75,11 +75,13 @@ private enum Singleton { for (DiscoverySelectorIdentifierParser parser : loadedParsers) { DiscoverySelectorIdentifierParser previous = parsersByPrefix.put(parser.getPrefix(), parser); Preconditions.condition(previous == null, - () -> String.format("Duplicate parser for prefix: [%s] candidate a: [%s] candidate b: [%s] ", + () -> String.format("Duplicate parser for prefix: [%s]; candidate a: [%s]; candidate b: [%s]", parser.getPrefix(), requireNonNull(previous).getClass().getName(), parser.getClass().getName())); } this.parsersByPrefix = unmodifiableMap(parsersByPrefix); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java index 5bdbb25fd8d5..1c6964579e13 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java @@ -930,8 +930,8 @@ public static UniqueIdSelector selectUniqueId(String uniqueId) { * * @param parentSelector the parent selector to select iterations for; never * {@code null} - * @param iterationIndices the iteration indices to select; never - * {@code null} or empty + * @param iterationIndices the iteration indices to select; never {@code null} + * or empty * @since 1.9 * @see IterationSelector */ @@ -943,11 +943,12 @@ public static IterationSelector selectIteration(DiscoverySelector parentSelector } /** - * Parse the supplied string representation of a - * {@link DiscoverySelectorIdentifier}. + * Parse the supplied string representation of a {@link DiscoverySelectorIdentifier}. * * @param identifier the string representation of a {@code DiscoverySelectorIdentifier}; * never {@code null} or blank + * @return an {@link Optional} containing the corresponding {@link DiscoverySelector}; + * never {@code null} but potentially empty * @since 1.11 * @see DiscoverySelectorIdentifierParser */ @@ -961,6 +962,8 @@ public static Optional parse(String identifier) { * * @param identifier the {@code DiscoverySelectorIdentifier} to parse; * never {@code null} + * @return an {@link Optional} containing the corresponding {@link DiscoverySelector}; + * never {@code null} but potentially empty * @since 1.11 * @see DiscoverySelectorIdentifierParser */ @@ -975,6 +978,8 @@ public static Optional parse(DiscoverySelectorIdent * * @param identifiers the string representations of * {@code DiscoverySelectorIdentifiers} to parse; never {@code null} + * @return a stream of the corresponding {@link DiscoverySelector DiscoverySelectors}; + * never {@code null} but potentially empty * @since 1.11 * @see DiscoverySelectorIdentifierParser */ @@ -989,6 +994,8 @@ public static Stream parseAll(String... identifiers * * @param identifiers the {@code DiscoverySelectorIdentifiers} to parse; * never {@code null} + * @return a stream of the corresponding {@link DiscoverySelector DiscoverySelectors}; + * never {@code null} but potentially empty * @since 1.11 * @see DiscoverySelectorIdentifierParser */ @@ -996,4 +1003,5 @@ public static Stream parseAll(String... identifiers public static Stream parseAll(Collection identifiers) { return DiscoverySelectorIdentifierParsers.parseAll(identifiers); } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java index 6246fa58e4c3..7cb12802f1d6 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java @@ -112,7 +112,7 @@ public boolean equals(Object o) { @API(status = STABLE, since = "1.3") @Override public int hashCode() { - return Objects.hash(path, position); + return Objects.hash(this.path, this.position); } @Override @@ -158,5 +158,7 @@ public Optional parse(DiscoverySelectorIdentifier identifier, Cont } // )); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IterationSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IterationSelector.java index 965a86cdb379..c5060aed467a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IterationSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IterationSelector.java @@ -65,14 +65,14 @@ private SortedSet toSortedSet(int[] iterationIndices) { * Get the selected parent {@link DiscoverySelector}. */ public DiscoverySelector getParentSelector() { - return parentSelector; + return this.parentSelector; } /** * Get the selected iteration indices. */ public SortedSet getIterationIndices() { - return iterationIndices; + return this.iterationIndices; } @Override @@ -84,12 +84,12 @@ public boolean equals(Object o) { return false; } IterationSelector that = (IterationSelector) o; - return parentSelector.equals(that.parentSelector) && iterationIndices.equals(that.iterationIndices); + return this.parentSelector.equals(that.parentSelector) && this.iterationIndices.equals(that.iterationIndices); } @Override public int hashCode() { - return Objects.hash(parentSelector, iterationIndices); + return Objects.hash(this.parentSelector, this.iterationIndices); } @Override @@ -104,13 +104,14 @@ public String toString() { @Override public Optional toIdentifier() { - return parentSelector.toIdentifier().map(parentSelectorString -> DiscoverySelectorIdentifier.create( // + return this.parentSelector.toIdentifier().map(parentSelectorString -> DiscoverySelectorIdentifier.create( // IdentifierParser.PREFIX, // String.format("%s[%s]", parentSelectorString, formatIterationIndicesAsRanges())) // ); } private String formatIterationIndicesAsRanges() { + class Range { final int start; int end; @@ -120,10 +121,11 @@ class Range { this.end = start; } } + List ranges = new ArrayList<>(); - Range current = new Range(iterationIndices.first()); + Range current = new Range(this.iterationIndices.first()); ranges.add(current); - for (int n : iterationIndices.tailSet(current.start + 1)) { + for (int n : this.iterationIndices.tailSet(current.start + 1)) { if (n == current.end + 1) { current.end = n; } @@ -133,14 +135,14 @@ class Range { } } return ranges.stream() // - .map(r -> { - if (r.start == r.end) { - return String.valueOf(r.start); + .map(range -> { + if (range.start == range.end) { + return String.valueOf(range.start); } - if (r.start == r.end - 1) { - return r.start + "," + r.end; + if (range.start == range.end - 1) { + return range.start + "," + range.end; } - return r.start + ".." + r.end; + return range.start + ".." + range.end; }) // .collect(joining(",")); } @@ -185,5 +187,7 @@ private IntStream parseIndexDefinition(String value) { Integer.parseInt(lastIndex))// ); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java index 7f6659482311..c2df7e1af657 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java @@ -342,4 +342,5 @@ public Optional parse(DiscoverySelectorIdentifier identifier, Co } } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java index 293654370f8e..140610901155 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java @@ -102,5 +102,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectModule(identifier.getValue())); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java index cfa1dd6e2500..5c0ae7a542cb 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java @@ -180,5 +180,7 @@ public Optional parse(DiscoverySelectorIdentifier identifie return Optional.of( DiscoverySelectors.selectNestedClass(parts.subList(0, parts.size() - 1), parts.get(parts.size() - 1))); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java index ae5d4a69fdc0..ff117ca99be7 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java @@ -284,5 +284,7 @@ public Optional parse(DiscoverySelectorIdentifier identifi return Optional.of(DiscoverySelectors.selectNestedMethod(enclosingClassNames, nestedClassName, methodName, parameterTypeNames)); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java index fc7da6fb5c6f..21801c7c21ad 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java @@ -102,5 +102,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectPackage(identifier.getValue())); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java index 08068b1d9ca6..4c0a00ade87c 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java @@ -103,5 +103,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectUniqueId(identifier.getValue())); } + } + } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java index 9e6ed0c45c8a..eb18583a93da 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java @@ -106,5 +106,7 @@ public String getPrefix() { public Optional parse(DiscoverySelectorIdentifier identifier, Context context) { return Optional.of(DiscoverySelectors.selectUri(identifier.getValue())); } + } + } From cfc9e65a1b16aa639db3dc1c506b27f70ad83026 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:20:14 +0200 Subject: [PATCH 10/62] Indent with tabs --- .../projects/graalvm-starter/settings.gradle.kts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts index 1399f18e3201..39f3134b19c6 100644 --- a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts +++ b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts @@ -1,11 +1,11 @@ pluginManagement { - plugins { - id("org.graalvm.buildtools.native") version "0.10.1" - } - repositories { - mavenCentral() - gradlePluginPortal() - } + plugins { + id("org.graalvm.buildtools.native") version "0.10.1" + } + repositories { + mavenCentral() + gradlePluginPortal() + } } rootProject.name = "graalvm-starter" From 3b0d2af31e16504c9dba030fd701de9febda08f8 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:20:49 +0200 Subject: [PATCH 11/62] Upgrade to GraalVM Native Build Tools 0.10.2 --- .../projects/graalvm-starter/settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts index 39f3134b19c6..7c15fd07d908 100644 --- a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts +++ b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { plugins { - id("org.graalvm.buildtools.native") version "0.10.1" + id("org.graalvm.buildtools.native") version "0.10.2" } repositories { mavenCentral() From 40bc1c4146d91b595668bd06402dba0a83d05b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Br=C3=BCnings?= Date: Mon, 26 Aug 2024 13:41:54 +0200 Subject: [PATCH 12/62] Fix potential double acquisition in `SingleLock` `SingleLock` uses a `ForkJoinPool.ManagedBlocker` for efficient blocking in a fork-join pool. In the `isReleasable()` method it calls `tryLock()` without remembering the outcome. The `block` method also unconditionally called `lockInterruptibly()` even if the lock was already acquired. The problem that can arise is that the lock is acquired multiple times, but only released once. `CompositeLockManagedBlocker` is also updated, so that `block()` checks for `acquired` before locking. --- .../docs/asciidoc/release-notes/release-notes-5.11.1.adoc | 3 ++- .../engine/support/hierarchical/CompositeLock.java | 6 ++++-- .../platform/engine/support/hierarchical/SingleLock.java | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc index 48a5c8fdf324..b27f74c910ce 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc @@ -16,7 +16,8 @@ JUnit repository on GitHub. [[release-notes-5.11.1-junit-platform-bug-fixes]] ==== Bug Fixes -* ❓ +* Fix potential locking issue with `ExclusiveResource` in the `HierarchicalTestExecutorService`. + This could lead to deadlocks in certain scenarios. [[release-notes-5.11.1-junit-platform-deprecations-and-breaking-changes]] ==== Deprecations and Breaking Changes diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java index df5ea0a5f3e3..18b628b0fdde 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java @@ -68,8 +68,10 @@ private class CompositeLockManagedBlocker implements ForkJoinPool.ManagedBlocker @Override public boolean block() throws InterruptedException { - acquireAllLocks(); - acquired = true; + if (!acquired) { + acquireAllLocks(); + acquired = true; + } return true; } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java index 23840449bd63..b5f6e80d8089 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java @@ -46,14 +46,16 @@ private class SingleLockManagedBlocker implements ForkJoinPool.ManagedBlocker { @Override public boolean block() throws InterruptedException { - lock.lockInterruptibly(); - acquired = true; + if (!acquired) { + lock.lockInterruptibly(); + acquired = true; + } return true; } @Override public boolean isReleasable() { - return acquired || lock.tryLock(); + return acquired || (acquired = lock.tryLock()); } } From 044f5cf4b066d3f2121a33db4a8d3952355d5225 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sun, 8 Sep 2024 13:55:26 +0200 Subject: [PATCH 13/62] Polishing --- .../release-notes/release-notes-5.11.1.adoc | 8 ++++---- .../support/hierarchical/CompositeLock.java | 16 ++++++++-------- .../engine/support/hierarchical/SingleLock.java | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc index b27f74c910ce..80f58d56d747 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.1.adoc @@ -6,8 +6,8 @@ *Scope:* minor bug fixes and improvements since 5.11.0 For a complete list of all _closed_ issues and pull requests for this release, consult the -link:{junit5-repo}+/milestone/79?closed=1+[5.11.1] milestone page in the -JUnit repository on GitHub. +link:{junit5-repo}+/milestone/79?closed=1+[5.11.1] milestone page in the JUnit repository +on GitHub. [[release-notes-5.11.1-junit-platform]] @@ -16,8 +16,8 @@ JUnit repository on GitHub. [[release-notes-5.11.1-junit-platform-bug-fixes]] ==== Bug Fixes -* Fix potential locking issue with `ExclusiveResource` in the `HierarchicalTestExecutorService`. - This could lead to deadlocks in certain scenarios. +* Fixed potential locking issue with `ExclusiveResource` in the + `HierarchicalTestExecutorService`, which could lead to deadlocks in certain scenarios. [[release-notes-5.11.1-junit-platform-deprecations-and-breaking-changes]] ==== Deprecations and Breaking Changes diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java index 18b628b0fdde..3718d82a64fc 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java @@ -28,7 +28,7 @@ class CompositeLock implements ResourceLock { // for tests only List getLocks() { - return locks; + return this.locks; } @Override @@ -38,9 +38,9 @@ public ResourceLock acquire() throws InterruptedException { } private void acquireAllLocks() throws InterruptedException { - List acquiredLocks = new ArrayList<>(locks.size()); + List acquiredLocks = new ArrayList<>(this.locks.size()); try { - for (Lock lock : locks) { + for (Lock lock : this.locks) { lock.lockInterruptibly(); acquiredLocks.add(lock); } @@ -53,7 +53,7 @@ private void acquireAllLocks() throws InterruptedException { @Override public void release() { - release(locks); + release(this.locks); } private void release(List acquiredLocks) { @@ -64,20 +64,20 @@ private void release(List acquiredLocks) { private class CompositeLockManagedBlocker implements ForkJoinPool.ManagedBlocker { - private boolean acquired; + private volatile boolean acquired; @Override public boolean block() throws InterruptedException { - if (!acquired) { + if (!this.acquired) { acquireAllLocks(); - acquired = true; + this.acquired = true; } return true; } @Override public boolean isReleasable() { - return acquired; + return this.acquired; } } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java index b5f6e80d8089..e568b9a8f5c0 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java @@ -26,7 +26,7 @@ class SingleLock implements ResourceLock { // for tests only Lock getLock() { - return lock; + return this.lock; } @Override @@ -37,25 +37,25 @@ public ResourceLock acquire() throws InterruptedException { @Override public void release() { - lock.unlock(); + this.lock.unlock(); } private class SingleLockManagedBlocker implements ForkJoinPool.ManagedBlocker { - private boolean acquired; + private volatile boolean acquired; @Override public boolean block() throws InterruptedException { - if (!acquired) { - lock.lockInterruptibly(); - acquired = true; + if (!this.acquired) { + SingleLock.this.lock.lockInterruptibly(); + this.acquired = true; } return true; } @Override public boolean isReleasable() { - return acquired || (acquired = lock.tryLock()); + return this.acquired || (this.acquired = SingleLock.this.lock.tryLock()); } } From 16ab431ac14df4ede8a2d9129315b6b96e3136ee Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 13:01:10 +0200 Subject: [PATCH 14/62] Disable Configuration Cache by default but enable it on CI when possible There were too many hiccups, the `asciidoctor` and `eclipse` tasks being the most prominent examples. --- .github/actions/main-build/action.yml | 2 +- .github/workflows/cross-version.yml | 6 ++++-- .github/workflows/main.yml | 12 +++++------- .github/workflows/reproducible-build.yml | 3 ++- gradle.properties | 1 - 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/main-build/action.yml b/.github/actions/main-build/action.yml index b9acd2f3c045..4c6c611412d7 100644 --- a/.github/actions/main-build/action.yml +++ b/.github/actions/main-build/action.yml @@ -4,7 +4,7 @@ inputs: arguments: required: true description: Gradle arguments - default: :platform-tooling-support-tests:test build + default: :platform-tooling-support-tests:test build --configuration-cache runs: using: "composite" steps: diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 97b19e9ed8b5..2a760cfe25fe 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -47,7 +47,8 @@ jobs: arguments: | -PjavaToolchain.version=${{ matrix.jdk.version }} \ -Dscan.tag.JDK_${{ matrix.jdk.version }} \ - build + build \ + --configuration-cache openj9: strategy: fail-fast: false @@ -81,4 +82,5 @@ jobs: -PjavaToolchain.implementation=j9 \ -Dscan.tag.JDK_${{ matrix.jdk }} \ -Dscan.tag.OpenJ9 \ - build + build \ + --configuration-cache diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb456f95beb3..fce0b7512bc1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,8 @@ jobs: -Ptesting.enableJaCoCo \ :platform-tooling-support-tests:test \ build \ - jacocoRootReport + jacocoRootReport \ + --configuration-cache - name: Upload to Codecov.io uses: codecov/codecov-action@v4 with: @@ -81,8 +82,7 @@ jobs: with: arguments: | publish -x check \ - prepareGitHubAttestation \ - --no-configuration-cache + prepareGitHubAttestation - name: Generate build provenance attestations uses: actions/attest-build-provenance@210c1913531870065f03ce1f9440dd87bc0938cd # v1.4.0 with: @@ -109,15 +109,13 @@ jobs: with: arguments: | prepareDocsForUploadToGhPages \ - -Dscan.tag.Documentation \ - --no-configuration-cache + -Dscan.tag.Documentation - name: Upload Documentation if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' uses: ./.github/actions/run-gradle with: arguments: | gitPublishPush \ - -Dscan.tag.Documentation \ - --no-configuration-cache + -Dscan.tag.Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 5866318d1356..9bf66f6b3fd3 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -24,7 +24,8 @@ jobs: - name: Restore Gradle cache and display toolchains uses: ./.github/actions/run-gradle with: - arguments: --quiet + arguments: --quiet \ + --configuration-cache - name: Build and compare checksums shell: bash run: | diff --git a/gradle.properties b/gradle.properties index 1ea6fe5cdd9c..9fc0c535e8f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,6 @@ org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -org.gradle.configuration-cache=true org.gradle.caching=true org.gradle.parallel=true org.gradle.java.installations.fromEnv=JDK8,JDK18,JDK19,JDK20,JDK21,JDK22,JDK23,JDK24 From c1843e44dbf09158b65986c05a3dacbc6ca1a970 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 13:32:16 +0200 Subject: [PATCH 15/62] Disable ArchUnitTests on JDK 24 and later --- gradle/libs.versions.toml | 3 +++ .../java/platform/tooling/support/tests/ArchUnitTests.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6ec9b4616f49..89a76c1ff3ab 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,7 +24,10 @@ ant = { module = "org.apache.ant:ant", version.ref = "ant" } ant-junit = { module = "org.apache.ant:ant-junit", version.ref = "ant" } ant-junitlauncher = { module = "org.apache.ant:ant-junitlauncher", version.ref = "ant" } apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } + +# check whether @DisabledForJreRange condition on ArchUnitTests can be updated when updating archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "1.3.0" } + assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } bndlib = { module = "biz.aQute.bnd:biz.aQute.bndlib", version.ref = "bnd" } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java index ff32c0777736..a0504901de9d 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java @@ -41,7 +41,10 @@ import org.apiguardian.api.API; import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; +@DisabledForJreRange(min = JRE.JAVA_24) @Order(Integer.MAX_VALUE) @AnalyzeClasses(locations = ArchUnitTests.AllJars.class) class ArchUnitTests { From 48624faf726a5e0df8e05c4e00a0237032e924bf Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 13:34:37 +0200 Subject: [PATCH 16/62] Fix YAML syntax --- .github/workflows/reproducible-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 9bf66f6b3fd3..a4466d4ca450 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -24,7 +24,8 @@ jobs: - name: Restore Gradle cache and display toolchains uses: ./.github/actions/run-gradle with: - arguments: --quiet \ + arguments: | + --quiet \ --configuration-cache - name: Build and compare checksums shell: bash From 1e50843c38b2b7eaf0659521b7bb792aeeeb9e13 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:01:42 +0200 Subject: [PATCH 17/62] Delete unnecessary (and potentially misleading) comment in User Guide --- documentation/src/docs/asciidoc/user-guide/writing-tests.adoc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 49a5d4ff3f9b..3a161bf3185f 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -2428,10 +2428,6 @@ lambda expression for a dynamic test, those fields will not be reset by callback or extensions between the execution of individual dynamic tests generated by the same `@TestFactory` method. -As of JUnit Jupiter {jupiter-version}, dynamic tests must always be created by factory -methods; however, this might be complemented by a registration facility in a later -release. - [[writing-tests-dynamic-tests-examples]] ==== Dynamic Test Examples From 3c51d9282b1150253b6bcfa8302c3023994f84b9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 14:03:46 +0200 Subject: [PATCH 18/62] Only run ArchUnit tests on JDKs < 24 --- gradle/libs.versions.toml | 2 +- .../platform-tooling-support-tests.gradle.kts | 7 +++++-- .../java/platform/tooling/support/tests/ArchUnitTests.java | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 89a76c1ff3ab..b4066ff064d4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,7 +25,7 @@ ant-junit = { module = "org.apache.ant:ant-junit", version.ref = "ant" } ant-junitlauncher = { module = "org.apache.ant:ant-junitlauncher", version.ref = "ant" } apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } -# check whether @DisabledForJreRange condition on ArchUnitTests can be updated when updating +# check whether the Java condition in platform-tooling-support-tests.gradle.kts can be changed when updating archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "1.3.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 9b7d6c805f1b..181cd73cf1c5 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -1,3 +1,4 @@ + import com.gradle.develocity.agent.gradle.internal.test.TestDistributionConfigurationInternal import junitbuild.extensions.capitalized import org.gradle.api.tasks.PathSensitivity.RELATIVE @@ -142,8 +143,10 @@ tasks.test { jvmArgumentProviders += JarPath(project, antJarsClasspath.get(), "antJars") jvmArgumentProviders += MavenDistribution(project, unzipMavenDistribution, mavenDistributionDir) - (options as JUnitPlatformOptions).apply { - includeEngines("archunit") + if (buildParameters.javaToolchain.version.orElse(21) < 24) { + (options as JUnitPlatformOptions).apply { + includeEngines("archunit") + } } inputs.apply { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java index a0504901de9d..ff32c0777736 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java @@ -41,10 +41,7 @@ import org.apiguardian.api.API; import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.condition.DisabledForJreRange; -import org.junit.jupiter.api.condition.JRE; -@DisabledForJreRange(min = JRE.JAVA_24) @Order(Integer.MAX_VALUE) @AnalyzeClasses(locations = ArchUnitTests.AllJars.class) class ArchUnitTests { From d9d023fccd27e0339fea5fbc082172b6347ea962 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 14:23:27 +0200 Subject: [PATCH 19/62] Fix build script --- .../platform-tooling-support-tests.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 181cd73cf1c5..3938425035a3 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -143,7 +143,7 @@ tasks.test { jvmArgumentProviders += JarPath(project, antJarsClasspath.get(), "antJars") jvmArgumentProviders += MavenDistribution(project, unzipMavenDistribution, mavenDistributionDir) - if (buildParameters.javaToolchain.version.orElse(21) < 24) { + if (buildParameters.javaToolchain.version.getOrElse(21) < 24) { (options as JUnitPlatformOptions).apply { includeEngines("archunit") } From 52d81763e1055c0ee3733ee71ab28e2e3867054a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 14:57:29 +0200 Subject: [PATCH 20/62] Fix integration tests running Maven on JDK 24 --- .../support/tests/JavaVersionsTests.java | 16 ++++++----- .../tooling/support/tests/MavenEnvVars.java | 27 +++++++++++++++++++ .../support/tests/MultiReleaseJarTests.java | 12 ++++++--- 3 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java index 54702715df5f..d7785cd6e1ad 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java @@ -18,6 +18,7 @@ import java.nio.file.Path; import java.util.List; +import java.util.Map; import de.sormuras.bartholdy.tool.Java; @@ -36,28 +37,31 @@ class JavaVersionsTests { void java_8() { var java8Home = Helper.getJavaHome("8"); assumeTrue(java8Home.isPresent(), "Java 8 installation directory not found!"); - var actualLines = execute("8", java8Home.get()); + var actualLines = execute("8", java8Home.get(), Map.of()); assertTrue(actualLines.contains("[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1")); } @Test void java_default() { - var actualLines = execute("default", new Java().getHome()); + var actualLines = execute("default", new Java().getHome(), MavenEnvVars.FOR_JDK24_AND_LATER); assertTrue(actualLines.contains("[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1")); } - List execute(String version, Path javaHome) { - var result = Request.builder() // + List execute(String version, Path javaHome, Map environmentVars) { + var builder = Request.builder() // .setTool(Request.maven()) // .setProject(Projects.JAVA_VERSIONS) // .setWorkspace("java-versions-" + version) // .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("--update-snapshots", "--batch-mode", "verify") // .setTimeout(TOOL_TIMEOUT) // - .setJavaHome(javaHome) // - .build().run(); + .setJavaHome(javaHome); + environmentVars.forEach(builder::putEnvironment); + + var result = builder.build().run(); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertEquals("", result.getOutput("err")); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java new file mode 100644 index 000000000000..bcec609010a0 --- /dev/null +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java @@ -0,0 +1,27 @@ +/* + * Copyright 2015-2024 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package platform.tooling.support.tests; + +import java.util.Map; + +import org.junit.jupiter.api.condition.JRE; + +final class MavenEnvVars { + + // https://issues.apache.org/jira/browse/MNG-8248 + static final Map FOR_JDK24_AND_LATER = JRE.currentVersion().compareTo(JRE.JAVA_24) >= 0 // + ? Map.of("MAVEN_OPTS", "--enable-native-access=ALL-UNNAMED") // + : Map.of(); + + private MavenEnvVars() { + } + +} diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java index 8ca29012b767..33105f0983f4 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java @@ -19,6 +19,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import java.util.Map; import de.sormuras.bartholdy.Result; @@ -82,15 +83,18 @@ void checkDefault() throws Exception { } private Result mvn(String variant) { - var result = Request.builder() // + Map environmentVars = MavenEnvVars.FOR_JDK24_AND_LATER; + + var builder = Request.builder() // .setTool(Request.maven()) // .setProject(Projects.MULTI_RELEASE_JAR) // .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("--update-snapshots", "--show-version", "--errors", "--batch-mode", "--file", variant, "test") // - .setTimeout(TOOL_TIMEOUT) // - .build() // - .run(); + .setTimeout(TOOL_TIMEOUT); + environmentVars.forEach(builder::putEnvironment); + + var result = builder.build().run(); assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); From 8665d6d68e01a92c69b77915e1000c6dae4e0aec Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 15:29:56 +0200 Subject: [PATCH 21/62] Track Java runtime version as part of Test/JavaExec cache key In order to detect changes in behavior between EA builds sooner --- .../junitbuild.java-toolchain-conventions.gradle.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.java-toolchain-conventions.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.java-toolchain-conventions.gradle.kts index c6b7e0120359..873ff64cfb1e 100644 --- a/gradle/plugins/common/src/main/kotlin/junitbuild.java-toolchain-conventions.gradle.kts +++ b/gradle/plugins/common/src/main/kotlin/junitbuild.java-toolchain-conventions.gradle.kts @@ -32,6 +32,17 @@ project.pluginManager.withPlugin("java") { tasks.withType().configureEach { javaLauncher = javaToolchainService.launcherFor(extension.toolchain) + if (javaLanguageVersion != defaultLanguageVersion) { + // Track exact version of Java to detect changes in behavior between EA builds sooner + inputs.property("javaRuntimeVersion", javaLauncher.get().metadata.javaRuntimeVersion) + } + } + + tasks.withType().configureEach { + if (javaLanguageVersion != defaultLanguageVersion) { + // Track exact version of Java to detect changes in behavior between EA builds sooner + inputs.property("javaRuntimeVersion", javaLauncher.get().metadata.javaRuntimeVersion) + } } tasks.withType().configureEach { From 9c1632c0201d62eb46c8a8af2758607aa2c03467 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 15:46:04 +0200 Subject: [PATCH 22/62] Schedule cross-version workflow to run once a week to spot new issues --- .github/workflows/cross-version.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 2a760cfe25fe..8a50878c10ec 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -1,6 +1,8 @@ name: Cross-Version on: + schedule: + - cron: '0 0 * * 6' // Every Saturday at 00:00 UTC push: branches: - main From 26d4dbe863bff6a3b05cd9f7fd561dfe3a02c1cf Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 9 Sep 2024 15:53:17 +0200 Subject: [PATCH 23/62] Fix YAML syntax --- .github/workflows/cross-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 8a50878c10ec..5813d8b5a430 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -2,7 +2,7 @@ name: Cross-Version on: schedule: - - cron: '0 0 * * 6' // Every Saturday at 00:00 UTC + - cron: '0 0 * * 6' # Every Saturday at 00:00 UTC push: branches: - main From 39ef1bc2dba26b225e3483a78fc319775046cfb3 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 10 Sep 2024 07:53:40 +0200 Subject: [PATCH 24/62] Fix `NO_COLOR` support in console launcher Closes #3328 --- .../docs/asciidoc/release-notes/release-notes-5.12.0-M1.adoc | 3 ++- .../junit/platform/console/options/AnsiColorOptionMixin.java | 4 +++- .../java/platform/tooling/support/tests/StandaloneTests.java | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.12.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.12.0-M1.adoc index 89a1753a5280..b935ad8a9832 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.12.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.12.0-M1.adoc @@ -16,7 +16,8 @@ JUnit repository on GitHub. [[release-notes-5.12.0-M1-junit-platform-bug-fixes]] ==== Bug Fixes -* ❓ +* Fix support for disabling ANSI colors on the console when the `NO_COLOR` environment + variable is available. [[release-notes-5.12.0-M1-junit-platform-deprecations-and-breaking-changes]] ==== Deprecations and Breaking Changes diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/AnsiColorOptionMixin.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/AnsiColorOptionMixin.java index bfd1bdbf1474..19a29afac5e7 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/AnsiColorOptionMixin.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/AnsiColorOptionMixin.java @@ -23,7 +23,9 @@ class AnsiColorOptionMixin { @Spec(MIXEE) CommandSpec commandSpec; - private boolean disableAnsiColors; + // https://no-color.org + // ANSI is disabled when environment variable NO_COLOR is defined (regardless of its value). + private boolean disableAnsiColors = System.getenv("NO_COLOR") != null; public boolean isDisableAnsiColors() { return disableAnsiColors; diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java index 98f3bb5104a4..e033b3e62e97 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java @@ -383,13 +383,13 @@ JUnit Jupiter > JupiterIntegration > disabled() private static Result discover(String... args) { var result = Request.builder() // + .putEnvironment("NO_COLOR", "1") // --disable-ansi-colors .setTool(new Java()) // .setProject(Projects.STANDALONE) // .addArguments("-jar", MavenRepo.jar("junit-platform-console-standalone")) // .addArguments("discover") // .addArguments("--scan-class-path") // .addArguments("--disable-banner") // - .addArguments("--disable-ansi-colors") // .addArguments("--include-classname", "standalone.*") // .addArguments("--classpath", "bin") // .addArguments((Object[]) args) // @@ -405,6 +405,7 @@ private static Result discover(String... args) { @Order(3) void execute() throws IOException { var result = Request.builder() // + .putEnvironment("NO_COLOR", "1") // --disable-ansi-colors .setTool(new Java()) // .setProject(Projects.STANDALONE) // .addArguments("--show-version") // From 3629c0d4f9fd83dcfba6591236a8aa669a6cbc3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:13:09 +0200 Subject: [PATCH 25/62] Configure Renovate (#3950) * Configure presets * Disable major updates for Groovy and Spock * Prevent automated updates to SNAPSHOT versions of open-test-reporting --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Marc Philipp --- .github/renovate.json5 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 000000000000..1fcd1c29c90a --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,33 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:best-practices", + "group:all", + ":automergeAll", + "schedule:weekly", + ], + packageRules: [ + // Disable major version upgrades for Groovy versions + // as we want to keep one for each major version. + // The same applies for Spock as we test the Vintage engine integration + { + matchPackagePrefixes: ["org.codehaus.groovy:"], + matchCurrentValue: "/^2\\./", + allowedVersions: "(,3.0)" + }, + { + matchPackagePrefixes: ["org.apache.groovy:"], + matchCurrentValue: "/^4\\./", + allowedVersions: "(,5.0)" + }, + { + matchPackagePrefixes: ["org.spockframework:"], + matchCurrentValue: "/^1\\./", + allowedVersions: "/^1\\..*-groovy-2\\.*/" + }, + { + matchPackagePrefixes: ["org.opentest4j.reporting:"], + allowedVersions: "!/-SNAPSHOT$/" + }, + ] +} From 003a9b486de75538a1b817d392a9842081dd233d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 07:15:13 +0000 Subject: [PATCH 26/62] Migrate config .github/renovate.json5 --- .github/renovate.json5 | 47 +++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1fcd1c29c90a..48ab9134044e 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,33 +1,38 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:best-practices", - "group:all", - ":automergeAll", - "schedule:weekly", + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: [ + 'config:best-practices', + 'group:all', + ':automergeAll', + 'schedule:weekly', ], packageRules: [ - // Disable major version upgrades for Groovy versions - // as we want to keep one for each major version. - // The same applies for Spock as we test the Vintage engine integration { - matchPackagePrefixes: ["org.codehaus.groovy:"], - matchCurrentValue: "/^2\\./", - allowedVersions: "(,3.0)" + matchCurrentValue: '/^2\\./', + allowedVersions: '(,3.0)', + matchPackageNames: [ + 'org.codehaus.groovy:{/,}**', + ], }, { - matchPackagePrefixes: ["org.apache.groovy:"], - matchCurrentValue: "/^4\\./", - allowedVersions: "(,5.0)" + matchCurrentValue: '/^4\\./', + allowedVersions: '(,5.0)', + matchPackageNames: [ + 'org.apache.groovy:{/,}**', + ], }, { - matchPackagePrefixes: ["org.spockframework:"], - matchCurrentValue: "/^1\\./", - allowedVersions: "/^1\\..*-groovy-2\\.*/" + matchCurrentValue: '/^1\\./', + allowedVersions: '/^1\\..*-groovy-2\\.*/', + matchPackageNames: [ + 'org.spockframework:{/,}**', + ], }, { - matchPackagePrefixes: ["org.opentest4j.reporting:"], - allowedVersions: "!/-SNAPSHOT$/" + allowedVersions: '!/-SNAPSHOT$/', + matchPackageNames: [ + 'org.opentest4j.reporting:{/,}**', + ], }, - ] + ], } From 762c68cec431e3667dad0ede10d6fa373075574d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 12:31:13 +0200 Subject: [PATCH 27/62] Ignore Eclipse JDT 4.33.0 Due to diffplug/spotless#2255 --- .github/renovate.json5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 48ab9134044e..dfe5750341e8 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -34,5 +34,14 @@ 'org.opentest4j.reporting:{/,}**', ], }, + { + allowedVersions: '!/4\\.33\\.0/', + description: [ + 'Due to https://github.com/diffplug/spotless/issues/2255', + ], + matchPackageNames: [ + 'org.eclipse.platform:{/,}**' + ] + }, ], } From 6fe353f374e0399e788294b22e2375e19a385655 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 13:00:05 +0200 Subject: [PATCH 28/62] Bump Maven Surefire plugin to 3.5.0 --- platform-tooling-support-tests/projects/vintage/pom.xml | 2 +- .../tooling/support/tests/VintageMavenIntegrationTests.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform-tooling-support-tests/projects/vintage/pom.xml b/platform-tooling-support-tests/projects/vintage/pom.xml index 47a0f145cf89..11f500cd1e1c 100644 --- a/platform-tooling-support-tests/projects/vintage/pom.xml +++ b/platform-tooling-support-tests/projects/vintage/pom.xml @@ -43,7 +43,7 @@ maven-surefire-plugin - 2.22.2 + 3.5.0 diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index 3358881d600f..398c5a13ff03 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -31,8 +31,9 @@ class VintageMavenIntegrationTests { void unsupportedVersion() { var result = run("4.11"); - assertThat(result.getExitCode()).isEqualTo(0); + assertThat(result.getExitCode()).isEqualTo(1); assertThat(result.getOutput("out")) // + .contains("TestEngine with ID 'junit-vintage' failed to discover tests") // .contains("Tests run: 0, Failures: 0, Errors: 0, Skipped: 0"); } From 816713bbae0853a95a27a285372092276bd6c676 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 12:48:21 +0200 Subject: [PATCH 29/62] Group PRs by package manager --- .github/renovate.json5 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index dfe5750341e8..a66aa83b3116 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -2,11 +2,34 @@ $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: [ 'config:best-practices', - 'group:all', ':automergeAll', 'schedule:weekly', ], packageRules: [ + { + groupName: 'Maven dependencies', + matchManagers: [ + 'maven' + ], + }, + { + groupName: 'Gradle dependencies', + matchManagers: [ + 'gradle' + ], + }, + { + groupName: 'GitHub Actions', + matchManagers: [ + 'github-actions' + ], + }, + { + groupName: 'Gradle wrapper', + matchManagers: [ + 'gradle-wrapper' + ], + }, { matchCurrentValue: '/^2\\./', allowedVersions: '(,3.0)', From 1377648e16444c89e632834acc409e4fc97e6561 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 13:09:03 +0200 Subject: [PATCH 30/62] Group by package manager regardless of update type --- .github/renovate.json5 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index a66aa83b3116..1c0eaf06d34d 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -11,24 +11,36 @@ matchManagers: [ 'maven' ], + matchUpdateTypes: [ + 'major', + 'minor', + 'patch', + ], }, { groupName: 'Gradle dependencies', matchManagers: [ 'gradle' ], + matchUpdateTypes: [ + 'major', + 'minor', + 'patch', + ] }, { groupName: 'GitHub Actions', matchManagers: [ 'github-actions' ], - }, - { - groupName: 'Gradle wrapper', - matchManagers: [ - 'gradle-wrapper' - ], + matchUpdateTypes: [ + 'major', + 'minor', + 'patch', + 'pin', + 'pinDigest', + 'digest' + ] }, { matchCurrentValue: '/^2\\./', From 5ab702be281e25fe2a25de614d402a9c0e90016a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 13:20:18 +0200 Subject: [PATCH 31/62] Delete custom groups It's easier to revert updates if they're from separate PRs. --- .github/renovate.json5 | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1c0eaf06d34d..e934b36ed7f0 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -6,42 +6,6 @@ 'schedule:weekly', ], packageRules: [ - { - groupName: 'Maven dependencies', - matchManagers: [ - 'maven' - ], - matchUpdateTypes: [ - 'major', - 'minor', - 'patch', - ], - }, - { - groupName: 'Gradle dependencies', - matchManagers: [ - 'gradle' - ], - matchUpdateTypes: [ - 'major', - 'minor', - 'patch', - ] - }, - { - groupName: 'GitHub Actions', - matchManagers: [ - 'github-actions' - ], - matchUpdateTypes: [ - 'major', - 'minor', - 'patch', - 'pin', - 'pinDigest', - 'digest' - ] - }, { matchCurrentValue: '/^2\\./', allowedVersions: '(,3.0)', From 807bcf20d8f4440e0809a4b9f91951817101b9c5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 14:21:39 +0200 Subject: [PATCH 32/62] Only cancel in-progress documentation jobs when result will be uploaded --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fce0b7512bc1..ce486d491a63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,7 +92,7 @@ jobs: name: Build Documentation concurrency: group: github-pages - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' }} needs: Linux runs-on: ubuntu-latest steps: From 0b401510daf2b77618ed8e7b68b6793809ec2f35 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 14:35:34 +0200 Subject: [PATCH 33/62] Include github.ref in concurrency group to avoid unnecessary conflicts --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce486d491a63..36d06b7beaab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -91,8 +91,8 @@ jobs: documentation: name: Build Documentation concurrency: - group: github-pages - cancel-in-progress: ${{ github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' }} + group: github-pages-${{ github.ref }} + cancel-in-progress: true needs: Linux runs-on: ubuntu-latest steps: From c5b1a392738d390ca934f1291bcc408530482eb6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:38:41 +0000 Subject: [PATCH 34/62] Pin dependencies --- .github/actions/run-gradle/action.yml | 4 ++-- .github/actions/setup-test-jdk/action.yml | 2 +- .github/workflows/close-inactive-issues.yml | 2 +- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/combine-prs.yml | 2 +- .github/workflows/cross-version.yml | 6 +++--- .github/workflows/gradle-dependency-submission.yml | 6 +++--- .github/workflows/label-opened-issues.yml | 2 +- .github/workflows/main.yml | 14 +++++++------- .github/workflows/reproducible-build.yml | 2 +- .github/workflows/unlabel-closed-issues.yml | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/actions/run-gradle/action.yml b/.github/actions/run-gradle/action.yml index 4103d29bab8d..e825551ce6f5 100644 --- a/.github/actions/run-gradle/action.yml +++ b/.github/actions/run-gradle/action.yml @@ -8,13 +8,13 @@ inputs: runs: using: "composite" steps: - - uses: actions/setup-java@v4 + - uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4 id: setup-gradle-jdk with: distribution: temurin java-version: 21 check-latest: true - - uses: gradle/actions/setup-gradle@v4 + - uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4 - shell: bash env: JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }} diff --git a/.github/actions/setup-test-jdk/action.yml b/.github/actions/setup-test-jdk/action.yml index 70a571e59a7f..9492cfae4ad6 100644 --- a/.github/actions/setup-test-jdk/action.yml +++ b/.github/actions/setup-test-jdk/action.yml @@ -8,7 +8,7 @@ inputs: runs: using: "composite" steps: - - uses: actions/setup-java@v4 + - uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4 with: distribution: ${{ inputs.distribution }} java-version: 8 diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml index fef88e94d267..687cfcdc4f19 100644 --- a/.github/workflows/close-inactive-issues.yml +++ b/.github/workflows/close-inactive-issues.yml @@ -10,7 +10,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@v9 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 with: only-labels: "status: waiting-for-feedback" days-before-stale: 14 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 264bcc0a79f7..133179e59c25 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,9 +30,9 @@ jobs: - javascript steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3 with: languages: ${{ matrix.language }} tools: latest @@ -44,4 +44,4 @@ jobs: -Dscan.tag.CodeQL \ allMainClasses - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3 diff --git a/.github/workflows/combine-prs.yml b/.github/workflows/combine-prs.yml index 29df14a19746..593acdf8a7aa 100644 --- a/.github/workflows/combine-prs.yml +++ b/.github/workflows/combine-prs.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: combine-prs - uses: github/combine-prs@v5.1.0 + uses: github/combine-prs@20d70f9d80eeb5958667d0602da433bd04ca6713 # v5.1.0 with: github_token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 5813d8b5a430..9a9cc5712455 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Set up Test JDK @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Set up Test JDK @@ -68,7 +68,7 @@ jobs: with: distribution: semeru - name: 'Set up JDK ${{ matrix.jdk }}' - uses: actions/setup-java@v4 + uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4 with: distribution: semeru java-version: ${{ matrix.jdk }} diff --git a/.github/workflows/gradle-dependency-submission.yml b/.github/workflows/gradle-dependency-submission.yml index 63f483f77f70..c867584a5835 100644 --- a/.github/workflows/gradle-dependency-submission.yml +++ b/.github/workflows/gradle-dependency-submission.yml @@ -14,14 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Setup Java - uses: actions/setup-java@v4 + uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4 with: distribution: temurin java-version: 21 check-latest: true - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@v4 + uses: gradle/actions/dependency-submission@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4 diff --git a/.github/workflows/label-opened-issues.yml b/.github/workflows/label-opened-issues.yml index 066596b43c85..9c98295a1840 100644 --- a/.github/workflows/label-opened-issues.yml +++ b/.github/workflows/label-opened-issues.yml @@ -9,7 +9,7 @@ jobs: permissions: issues: write steps: - - uses: actions/github-script@v7 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 with: script: | github.rest.issues.addLabels({ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36d06b7beaab..5004201b8660 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Install GraalVM - uses: graalvm/setup-graalvm@v1 + uses: graalvm/setup-graalvm@22cc13fe88ef133134b3798e128fb208df55e1f5 # v1 with: distribution: graalvm-community version: 'latest' @@ -37,7 +37,7 @@ jobs: jacocoRootReport \ --configuration-cache - name: Upload to Codecov.io - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -45,7 +45,7 @@ jobs: runs-on: windows-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Build @@ -55,7 +55,7 @@ jobs: runs-on: macos-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Build @@ -71,7 +71,7 @@ jobs: if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Publish @@ -97,7 +97,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Install Graphviz diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index a4466d4ca450..39eb9160dbdc 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: fetch-depth: 1 - name: Restore Gradle cache and display toolchains diff --git a/.github/workflows/unlabel-closed-issues.yml b/.github/workflows/unlabel-closed-issues.yml index cc476e4fccba..c48b1db534d5 100644 --- a/.github/workflows/unlabel-closed-issues.yml +++ b/.github/workflows/unlabel-closed-issues.yml @@ -9,7 +9,7 @@ jobs: permissions: issues: write steps: - - uses: actions/github-script@v7 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 with: script: | const issue = await github.rest.issues.get({ From 467fe81a7f1a1f76cbb13c9b687269cd6e2c34d0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 15:27:09 +0200 Subject: [PATCH 35/62] Allow Renovate to run around the clock --- .github/renovate.json5 | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e934b36ed7f0..153557ce6b10 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,6 @@ extends: [ 'config:best-practices', ':automergeAll', - 'schedule:weekly', ], packageRules: [ { From 21d9ac0e63d98aa74ffd2b4c9796bf1b8af14039 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:28:41 +0000 Subject: [PATCH 36/62] Update actions/attest-build-provenance action to v1.4.3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5004201b8660..3d80d89a1f19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: publish -x check \ prepareGitHubAttestation - name: Generate build provenance attestations - uses: actions/attest-build-provenance@210c1913531870065f03ce1f9440dd87bc0938cd # v1.4.0 + uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3 with: subject-path: documentation/build/attestation/*.jar From 0061f5787d9d24b43ffb33f7f1d5c2e3374b945c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:44:18 +0000 Subject: [PATCH 37/62] Update ant to v1.10.15 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b4066ff064d4..082c75b29290 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -ant = "1.10.14" +ant = "1.10.15" apiguardian = "1.1.2" asciidoctorj-pdf = "2.3.18" asciidoctor-plugins = "4.0.3" # Check if workaround in documentation.gradle.kts can be removed when upgrading From 0a9be89b99c04059d43a17cf26b9b5ad05eacb76 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 10 Sep 2024 15:44:11 +0200 Subject: [PATCH 38/62] Delete Combine PRs workflow since it's been replaced with Renovate --- .github/workflows/combine-prs.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/combine-prs.yml diff --git a/.github/workflows/combine-prs.yml b/.github/workflows/combine-prs.yml deleted file mode 100644 index 593acdf8a7aa..000000000000 --- a/.github/workflows/combine-prs.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Combine PRs - -on: - schedule: - - cron: '0 0 * * *' # Every day at 00:00 UTC - workflow_dispatch: - -jobs: - combine-prs: - if: github.repository == 'junit-team/junit5' - runs-on: ubuntu-latest - steps: - - name: combine-prs - uses: github/combine-prs@20d70f9d80eeb5958667d0602da433bd04ca6713 # v5.1.0 - with: - github_token: ${{ secrets.GH_TOKEN }} From 8c523d8b19ebcfadc6eee5c31b162cf16cc6ccaa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:13:29 +0000 Subject: [PATCH 39/62] Update dependency de.sormuras.junit:junit-platform-maven-plugin to v1.1.7 --- .../projects/multi-release-jar/default/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml b/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml index 0904feb98643..551fc455eb3f 100644 --- a/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml +++ b/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml @@ -45,7 +45,7 @@ de.sormuras.junit junit-platform-maven-plugin - 1.1.5 + 1.1.7 true JAVA From b11b6757d264abab41f1ab423b4b6413e8665117 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:39:51 +0000 Subject: [PATCH 40/62] Update dependency io.github.classgraph:classgraph to v4.8.175 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 082c75b29290..0235f4bfd8e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -32,7 +32,7 @@ assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } bndlib = { module = "biz.aQute.bnd:biz.aQute.bndlib", version.ref = "bnd" } checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" } -classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.174" } +classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.175" } commons-io = { module = "commons-io:commons-io", version = "2.16.1" } groovy4 = { module = "org.apache.groovy:groovy", version = "4.0.22" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.21" } From 44902082a5482d864ee02031567d9e48c903710a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:55:19 +0000 Subject: [PATCH 41/62] Update dependency org.apache.maven:apache-maven to v3.9.9 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0235f4bfd8e7..9de95916ea64 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -50,7 +50,7 @@ junit4 = { module = "junit:junit", version = { require = "[4.12,)", prefer = "4. kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.8.1" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4j" } -maven = { module = "org.apache.maven:apache-maven", version = "3.9.8" } +maven = { module = "org.apache.maven:apache-maven", version = "3.9.9" } mavenSurefirePlugin = { module = "org.apache.maven.plugins:maven-surefire-plugin", version.ref = "surefire" } memoryfilesystem = { module = "com.github.marschall:memoryfilesystem", version = "2.8.0" } mockito = { module = "org.mockito:mockito-junit-jupiter", version = "5.12.0" } From afc202c16082c814dcbf09fb223fe3159ed7e2a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:57:21 +0000 Subject: [PATCH 42/62] Update dependency org.codehaus.groovy:groovy-bom to v2.5.23 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9de95916ea64..98bd60916162 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -35,7 +35,7 @@ checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checks classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.175" } commons-io = { module = "commons-io:commons-io", version = "2.16.1" } groovy4 = { module = "org.apache.groovy:groovy", version = "4.0.22" } -groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.21" } +groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.23" } hamcrest = { module = "org.hamcrest:hamcrest", version = "3.0" } jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } From 213246ec269048327be76deba70af762e0fc867c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 01:24:01 +0000 Subject: [PATCH 43/62] Update dependency org.slf4j:slf4j-jdk14 to v2.0.16 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 98bd60916162..da24b6c8abb6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -59,7 +59,7 @@ opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" openTestReporting-events = { module = "org.opentest4j.reporting:open-test-reporting-events", version.ref = "openTestReporting" } openTestReporting-tooling = { module = "org.opentest4j.reporting:open-test-reporting-tooling", version.ref = "openTestReporting" } picocli = { module = "info.picocli:picocli", version = "4.7.6" } -slf4j-julBinding = { module = "org.slf4j:slf4j-jdk14", version = "2.0.13" } +slf4j-julBinding = { module = "org.slf4j:slf4j-jdk14", version = "2.0.16" } spock1 = { module = "org.spockframework:spock-core", version = "1.3-groovy-2.5" } univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } xmlunit-assertj = { module = "org.xmlunit:xmlunit-assertj3", version.ref = "xmlunit" } From 03c4b6ca3b220e2b6ff47b3e922e47491d1890d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 03:50:44 +0000 Subject: [PATCH 44/62] Update plugin org.graalvm.buildtools.native to v0.10.3 --- .../projects/graalvm-starter/settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts index 7c15fd07d908..ef491d025954 100644 --- a/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts +++ b/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { plugins { - id("org.graalvm.buildtools.native") version "0.10.2" + id("org.graalvm.buildtools.native") version "0.10.3" } repositories { mavenCentral() From 40109feb212a87e3c66ca1bdf54bea34c3fbb631 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:07:28 +0000 Subject: [PATCH 45/62] Update plugin org.jetbrains.kotlin.jvm to v1.9.25 --- .../projects/gradle-kotlin-extensions/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tooling-support-tests/projects/gradle-kotlin-extensions/build.gradle.kts b/platform-tooling-support-tests/projects/gradle-kotlin-extensions/build.gradle.kts index 51a6ffd269ad..ac2d236c6663 100644 --- a/platform-tooling-support-tests/projects/gradle-kotlin-extensions/build.gradle.kts +++ b/platform-tooling-support-tests/projects/gradle-kotlin-extensions/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "1.9.0" + kotlin("jvm") version "1.9.25" } repositories { From b2c22ce77166ea8609ff0d66cf08ec95e1a5578f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:08:07 +0000 Subject: [PATCH 46/62] Update dependency gradle to v8.10.1 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 68e8816d71c9..8e876e1c5571 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From b1b357b8cb5a683db77a528f37af4f16d9b74510 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:07:44 +0000 Subject: [PATCH 47/62] Update plugin shadow to v8.3.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index da24b6c8abb6..4424dd3fcc8c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -91,6 +91,6 @@ gitPublish = { id = "org.ajoberstar.git-publish", version = "4.2.2" } jmh = { id = "me.champeau.jmh", version = "0.7.2" } nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" } plantuml = { id = "io.freefair.plantuml", version = "8.6" } -shadow = { id = "com.gradleup.shadow", version = "8.3.0" } +shadow = { id = "com.gradleup.shadow", version = "8.3.1" } spotless = { id = "com.diffplug.spotless", version = "7.0.0.BETA1" } versions = { id = "com.github.ben-manes.versions", version = "0.51.0" } From a2097b2bbc32c73dc90009f3cefe6f952d0a9a32 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 11 Sep 2024 09:45:39 +0200 Subject: [PATCH 48/62] Disable annotation processing when compiling JTE templates --- .../kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt b/gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt index b76ad39345d6..918bcd53c468 100644 --- a/gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt +++ b/gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt @@ -45,6 +45,7 @@ abstract class GenerateJreRelatedSourceCode : DefaultTask() { val codeResolver = DirectoryCodeResolver(templateDir.toPath()) val templateEngine = TemplateEngine.create(codeResolver, temporaryDir.toPath(), ContentType.Plain, javaClass.classLoader) + templateEngine.setCompileArgs("-proc:none") val templates = templateDir.walkTopDown() .filter { it.extension == "jte" } From e74f94b57ce6a712b6686450ec480d0b7f05514d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 11 Sep 2024 16:10:03 +0200 Subject: [PATCH 49/62] Remove unused imports from integration test projects --- .../gradle-missing-engine/src/test/java/FooTests.java | 1 - .../src/test/java/com/example/project/DummyTests.java | 5 ----- .../integration/integration/JupiterIntegrationTests.java | 4 ---- 3 files changed, 10 deletions(-) diff --git a/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java b/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java index 97be110987fc..d389a1357fdf 100644 --- a/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java +++ b/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java @@ -10,7 +10,6 @@ */ import static org.junit.jupiter.api.Assertions.fail; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; class FooTests { diff --git a/platform-tooling-support-tests/projects/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java b/platform-tooling-support-tests/projects/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java index b9f8a24f46b0..4751e1f005c8 100644 --- a/platform-tooling-support-tests/projects/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java +++ b/platform-tooling-support-tests/projects/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java @@ -10,12 +10,7 @@ package com.example.project; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; class DummyTests { diff --git a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java index d3664cae5998..e5f363bc284c 100644 --- a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java +++ b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java @@ -11,7 +11,6 @@ package integration; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.junit.platform.launcher.EngineFilter.includeEngines; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; @@ -20,9 +19,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.junit.platform.engine.discovery.DiscoverySelectors; -import org.junit.platform.engine.discovery.ModuleSelector; -import org.junit.platform.launcher.TestIdentifier; -import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.core.LauncherFactory; @TestMethodOrder(Alphanumeric.class) From 971b60e41799023d6f8edcc4163f72f7eb52482f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 11 Sep 2024 16:10:51 +0200 Subject: [PATCH 50/62] Configure Spotless to remove unused imports --- .../src/main/kotlin/junitbuild.spotless-conventions.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.spotless-conventions.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.spotless-conventions.gradle.kts index 0e7090705073..5af8f263d205 100644 --- a/gradle/plugins/common/src/main/kotlin/junitbuild.spotless-conventions.gradle.kts +++ b/gradle/plugins/common/src/main/kotlin/junitbuild.spotless-conventions.gradle.kts @@ -34,6 +34,7 @@ spotless { eclipse(majorMinorVersion).configFile(javaFormatterConfigFile) trimTrailingWhitespace() endWithNewline() + removeUnusedImports() } } From a82af6b91e2ffc7271b47c705bc057031ea5fb11 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:11:33 +0000 Subject: [PATCH 51/62] Update plugin spotless to v7.0.0.BETA2 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4424dd3fcc8c..b3e310ea499c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -92,5 +92,5 @@ jmh = { id = "me.champeau.jmh", version = "0.7.2" } nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" } plantuml = { id = "io.freefair.plantuml", version = "8.6" } shadow = { id = "com.gradleup.shadow", version = "8.3.1" } -spotless = { id = "com.diffplug.spotless", version = "7.0.0.BETA1" } +spotless = { id = "com.diffplug.spotless", version = "7.0.0.BETA2" } versions = { id = "com.github.ben-manes.versions", version = "0.51.0" } From 3a0ba62d96f99f714007f2ad6390b0ce9fa2385e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:57:28 +0000 Subject: [PATCH 52/62] Update dependency com.puppycrawl.tools:checkstyle to v10.18.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b3e310ea499c..a41122c5d203 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ asciidoctorj-pdf = "2.3.18" asciidoctor-plugins = "4.0.3" # Check if workaround in documentation.gradle.kts can be removed when upgrading assertj = "3.26.3" bnd = "7.0.0" -checkstyle = "10.17.0" +checkstyle = "10.18.1" eclipse = "4.32.0" jackson = "2.17.2" jacoco = "0.8.12" From 81d2152b498c2c676a111e58583803c81127e828 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:58:01 +0000 Subject: [PATCH 53/62] Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.13.0 --- platform-tooling-support-tests/projects/java-versions/pom.xml | 2 +- platform-tooling-support-tests/projects/maven-starter/pom.xml | 2 +- .../projects/maven-surefire-compatibility/pom.xml | 2 +- .../projects/multi-release-jar/default/pom.xml | 2 +- platform-tooling-support-tests/projects/vintage/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform-tooling-support-tests/projects/java-versions/pom.xml b/platform-tooling-support-tests/projects/java-versions/pom.xml index 7123e267d45c..f4f3ddfd2cbf 100644 --- a/platform-tooling-support-tests/projects/java-versions/pom.xml +++ b/platform-tooling-support-tests/projects/java-versions/pom.xml @@ -33,7 +33,7 @@ maven-compiler-plugin - 3.8.1 + 3.13.0 1.8 1.8 diff --git a/platform-tooling-support-tests/projects/maven-starter/pom.xml b/platform-tooling-support-tests/projects/maven-starter/pom.xml index 18b577f81a4e..b65aec64a043 100644 --- a/platform-tooling-support-tests/projects/maven-starter/pom.xml +++ b/platform-tooling-support-tests/projects/maven-starter/pom.xml @@ -43,7 +43,7 @@ maven-compiler-plugin - 3.8.1 + 3.13.0 maven-surefire-plugin diff --git a/platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml b/platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml index 58f907ab1e05..5ad18aa4522b 100644 --- a/platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml +++ b/platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml @@ -38,7 +38,7 @@ maven-compiler-plugin - 3.8.1 + 3.13.0 maven-surefire-plugin diff --git a/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml b/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml index 551fc455eb3f..e76513937258 100644 --- a/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml +++ b/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml @@ -34,7 +34,7 @@ maven-compiler-plugin - 3.8.1 + 3.13.0 11 diff --git a/platform-tooling-support-tests/projects/vintage/pom.xml b/platform-tooling-support-tests/projects/vintage/pom.xml index 11f500cd1e1c..74d3bc4b67bd 100644 --- a/platform-tooling-support-tests/projects/vintage/pom.xml +++ b/platform-tooling-support-tests/projects/vintage/pom.xml @@ -39,7 +39,7 @@ maven-compiler-plugin - 3.8.1 + 3.13.0 maven-surefire-plugin From a97af4fab5b52dcc586eec88eebdda4095cea85e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:03:04 +0000 Subject: [PATCH 54/62] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.5.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a41122c5d203..95c2d8232a19 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ ktlint = "1.3.1" log4j = "2.23.1" opentest4j = "1.3.0" openTestReporting = "0.1.0-M2" -surefire = "3.3.1" +surefire = "3.5.0" xmlunit = "2.10.0" [libraries] From 750ca12140ce8466cacddf1b42d728b16b797aa3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:54:34 +0000 Subject: [PATCH 55/62] Update dependency org.mockito:mockito-junit-jupiter to v5.13.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 95c2d8232a19..8e6f26b2116a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,7 +53,7 @@ log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4 maven = { module = "org.apache.maven:apache-maven", version = "3.9.9" } mavenSurefirePlugin = { module = "org.apache.maven.plugins:maven-surefire-plugin", version.ref = "surefire" } memoryfilesystem = { module = "com.github.marschall:memoryfilesystem", version = "2.8.0" } -mockito = { module = "org.mockito:mockito-junit-jupiter", version = "5.12.0" } +mockito = { module = "org.mockito:mockito-junit-jupiter", version = "5.13.0" } nohttp-checkstyle = { module = "io.spring.nohttp:nohttp-checkstyle", version = "0.0.11" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } openTestReporting-events = { module = "org.opentest4j.reporting:open-test-reporting-events", version.ref = "openTestReporting" } From 5cd668eb96248b2782de9eb97c7f8f1066d094b7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 12 Sep 2024 07:46:41 +0200 Subject: [PATCH 56/62] Centralize repository declarations for custom Gradle plugins --- gradle/plugins/code-generator/build.gradle.kts | 4 ---- gradle/plugins/common/build.gradle.kts | 4 ---- gradle/plugins/settings.gradle.kts | 3 +++ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gradle/plugins/code-generator/build.gradle.kts b/gradle/plugins/code-generator/build.gradle.kts index d317808a7142..e9f2ef657e47 100644 --- a/gradle/plugins/code-generator/build.gradle.kts +++ b/gradle/plugins/code-generator/build.gradle.kts @@ -2,10 +2,6 @@ plugins { `kotlin-dsl` } -repositories { - gradlePluginPortal() -} - dependencies { implementation("junitbuild.base:code-generator-model") implementation(projects.common) diff --git a/gradle/plugins/common/build.gradle.kts b/gradle/plugins/common/build.gradle.kts index 0a93c96c0fee..6015360a7105 100644 --- a/gradle/plugins/common/build.gradle.kts +++ b/gradle/plugins/common/build.gradle.kts @@ -2,10 +2,6 @@ plugins { `kotlin-dsl` } -repositories { - gradlePluginPortal() -} - dependencies { implementation(projects.buildParameters) implementation(kotlin("gradle-plugin")) diff --git a/gradle/plugins/settings.gradle.kts b/gradle/plugins/settings.gradle.kts index 728290a2cad6..41935db0aa36 100644 --- a/gradle/plugins/settings.gradle.kts +++ b/gradle/plugins/settings.gradle.kts @@ -4,6 +4,9 @@ dependencyResolutionManagement { from(files("../libs.versions.toml")) } } + repositories { + gradlePluginPortal() + } } rootProject.name = "plugins" From c4fae49296eaf9feade28827bb734c3a04ebb3c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 05:47:44 +0000 Subject: [PATCH 57/62] Update log4j2 monorepo to v2.24.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e6f26b2116a..539d73925231 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ jmh = "1.37" junit4 = "4.13.2" junit4Min = "4.12" ktlint = "1.3.1" -log4j = "2.23.1" +log4j = "2.24.0" opentest4j = "1.3.0" openTestReporting = "0.1.0-M2" surefire = "3.5.0" From b3f008567ef2714d02875a9074f1ccd145921b5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 06:19:08 +0000 Subject: [PATCH 58/62] Update plugin develocity to v3.18.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 539d73925231..98403b1a3679 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -85,7 +85,7 @@ asciidoctorPdf = { id = "org.asciidoctor.jvm.pdf", version.ref = "asciidoctor-pl bnd = { id = "biz.aQute.bnd", version.ref = "bnd" } buildParameters = { id = "org.gradlex.build-parameters", version = "1.4.4" } commonCustomUserData = { id = "com.gradle.common-custom-user-data-gradle-plugin", version = "2.0.2" } -develocity = { id = "com.gradle.develocity", version = "3.17.6" } +develocity = { id = "com.gradle.develocity", version = "3.18.1" } foojayResolver = { id = "org.gradle.toolchains.foojay-resolver", version = "0.8.0" } gitPublish = { id = "org.ajoberstar.git-publish", version = "4.2.2" } jmh = { id = "me.champeau.jmh", version = "0.7.2" } From 75df5b8d789f17d4547406c26000e6ca57d5ce57 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 12 Sep 2024 09:09:28 +0200 Subject: [PATCH 59/62] Delete Eclipse JDT rule Can be handled by closing the Renovate PR for that version --- .github/renovate.json5 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 153557ce6b10..bc5b52e8cbfe 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -32,14 +32,5 @@ 'org.opentest4j.reporting:{/,}**', ], }, - { - allowedVersions: '!/4\\.33\\.0/', - description: [ - 'Due to https://github.com/diffplug/spotless/issues/2255', - ], - matchPackageNames: [ - 'org.eclipse.platform:{/,}**' - ] - }, ], } From 65aa610a325ec1b5b4f1c812b439763ea8f79443 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 12 Sep 2024 09:20:30 +0200 Subject: [PATCH 60/62] Reference org-level config preset --- .github/renovate.json5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index bc5b52e8cbfe..ea024d3d17e6 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,8 +1,7 @@ { $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: [ - 'config:best-practices', - ':automergeAll', + 'github>junit-team/renovate-config', ], packageRules: [ { From 9f5cfc9ee6da1198c38c83a2cd22c31b9f5c2e59 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 12 Sep 2024 16:14:23 +0200 Subject: [PATCH 61/62] Polish test --- ...lHierarchicalTestExecutorServiceTests.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorServiceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorServiceTests.java index b9544248f077..79120bf40d17 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorServiceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorServiceTests.java @@ -11,32 +11,24 @@ package org.junit.platform.engine.support.hierarchical; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.when; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.platform.commons.JUnitException; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -@ExtendWith(MockitoExtension.class) class ForkJoinPoolHierarchicalTestExecutorServiceTests { - @Mock - ParallelExecutionConfiguration configuration; - @Test void exceptionsFromInvalidConfigurationAreNotSwallowed() { - when(configuration.getParallelism()).thenReturn(2); - when(configuration.getMaxPoolSize()).thenReturn(1); // invalid, should be > parallelism - when(configuration.getCorePoolSize()).thenReturn(1); - when(configuration.getMinimumRunnable()).thenReturn(1); - when(configuration.getSaturatePredicate()).thenReturn(__ -> true); - when(configuration.getKeepAliveSeconds()).thenReturn(0); - - JUnitException exception = assertThrows(JUnitException.class, - () -> new ForkJoinPoolHierarchicalTestExecutorService(configuration)); + var configuration = new DefaultParallelExecutionConfiguration(2, 1, 1, 1, 0, __ -> true); + + JUnitException exception = assertThrows(JUnitException.class, () -> { + try (var pool = new ForkJoinPoolHierarchicalTestExecutorService(configuration)) { + assertNotNull(pool, "we won't get here"); + } + }); + assertThat(exception).hasMessage("Failed to create ForkJoinPool"); assertThat(exception).rootCause().isInstanceOf(IllegalArgumentException.class); } From eb5b398f7bbf4b53a6384b6cdb37ec9c01fb5bf3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 03:36:09 +0000 Subject: [PATCH 62/62] Update gradle/actions digest to d156388 --- .github/actions/run-gradle/action.yml | 2 +- .github/workflows/gradle-dependency-submission.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/run-gradle/action.yml b/.github/actions/run-gradle/action.yml index e825551ce6f5..f0ba06a50fd0 100644 --- a/.github/actions/run-gradle/action.yml +++ b/.github/actions/run-gradle/action.yml @@ -14,7 +14,7 @@ runs: distribution: temurin java-version: 21 check-latest: true - - uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4 + - uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4 - shell: bash env: JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }} diff --git a/.github/workflows/gradle-dependency-submission.yml b/.github/workflows/gradle-dependency-submission.yml index c867584a5835..a2f98e37c62e 100644 --- a/.github/workflows/gradle-dependency-submission.yml +++ b/.github/workflows/gradle-dependency-submission.yml @@ -24,4 +24,4 @@ jobs: java-version: 21 check-latest: true - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4 + uses: gradle/actions/dependency-submission@d156388eb19639ec20ade50009f3d199ce1e2808 # v4