This is an automated email from the ASF dual-hosted git repository. apkhmv pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push: new 88020818614 IGNITE-26042 Use boolean property in the compatibility tests (#6327) 88020818614 is described below commit 880208186143173aef8c8204ce2473092e7db692 Author: Vadim Pakhnushev <8614891+valep...@users.noreply.github.com> AuthorDate: Mon Jul 28 14:17:31 2025 +0300 IGNITE-26042 Use boolean property in the compatibility tests (#6327) --- modules/compatibility-tests/build.gradle | 15 ++++++++++++--- .../org/apache/ignite/internal/CompatibilityTestBase.java | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/modules/compatibility-tests/build.gradle b/modules/compatibility-tests/build.gradle index 57ed07a3bb9..66ae0be95cc 100644 --- a/modules/compatibility-tests/build.gradle +++ b/modules/compatibility-tests/build.gradle @@ -80,13 +80,13 @@ private def resolveAllDependencies(String dependencyNotation, String... addition return detached.resolve() // Set<File> of *.jar } -// This task resolves dependencies described in the file making them cached locally. If testAllVersions system property is not defined, at -// most 2 last versions are resolved +// This task resolves dependencies described in the file making them cached locally. If testAllVersions system property is not defined or is +// not equals to `true`, at most 2 last versions are resolved def resolveCompatibilityTestDependencies = tasks.register('resolveCompatibilityTestDependencies') { doLast { def versionsFile = file('src/testFixtures/resources/igniteVersions.json') def versionsJson = new JsonSlurper().parseText(versionsFile.text) - def versions = System.getProperty("testAllVersions") != null ? versionsJson.versions : versionsJson.versions.takeRight(2) + def versions = shouldTestAllVersions() ? versionsJson.versions : versionsJson.versions.takeRight(2) versions.each { version -> versionsJson.artifacts.each { artifact -> resolveAllDependencies("$artifact:$version.version") @@ -95,6 +95,15 @@ def resolveCompatibilityTestDependencies = tasks.register('resolveCompatibilityT } } +private shouldTestAllVersions() { + def value = System.getProperty("testAllVersions") + if (value != null) { + value = value.trim().toLowerCase() + return value.isEmpty() || "true".equals(value) + } + return false +} + integrationTest.dependsOn resolveCompatibilityTestDependencies tasks.register('constructArgFile') { diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java index 28d32c5694b..31c50a5a88a 100644 --- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java +++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java @@ -171,8 +171,8 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest { } /** - * Returns a list of base versions. If {@code testAllVersions} system property is set, then all versions are returned, otherwise, at - * most {@code numLatest} latest versions are taken. + * Returns a list of base versions. If {@code testAllVersions} system property is empty or set to {@code true}, then all versions are + * returned, otherwise, at most {@code numLatest} latest versions are taken. * * @param numLatest Number of latest versions to take by default. * @param skipVersions Array of strings to skip. @@ -184,7 +184,7 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest { .map(Version::version) .filter(Predicate.not(skipSet::contains)) .collect(Collectors.toList()); - if (System.getProperty("testAllVersions") != null) { + if (shouldTestAllVersions()) { return versions; } else { // Take at most numLatest latest versions. @@ -192,4 +192,13 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest { return versions.subList(fromIndex, versions.size()); } } + + private static boolean shouldTestAllVersions() { + String value = System.getProperty("testAllVersions"); + if (value != null) { + value = value.trim().toLowerCase(); + return value.isEmpty() || "true".equals(value); + } + return false; + } }