diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 2a0ea68e995..f024f3e80c5 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -565,10 +565,10 @@ When running `./gradlew check`, minimal bwc checks are also run against compatib Sometimes a backward compatibility change spans two versions. A common case is a new functionality that needs a BWC bridge in an unreleased versioned of a release branch (for example, 5.x). To test the changes, you can instruct Gradle to build the BWC version from a another remote/branch combination instead of -pulling the release branch from GitHub. You do so using the `tests.bwc.remote` and `tests.bwc.refspec.BRANCH` system properties: +pulling the release branch from GitHub. You do so using the `bwc.remote` and `bwc.refspec.BRANCH` system properties: ------------------------------------------------- -./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x +./gradlew check -Dbwc.remote=${remote} -Dbwc.refspec.5.x=index_req_bwc_5.x ------------------------------------------------- The branch needs to be available on the remote that the BWC makes of the @@ -583,7 +583,7 @@ will need to: will contain your change. . Create a branch called `index_req_bwc_5.x` off `5.x`. This will contain your bwc layer. . Push both branches to your remote repository. -. Run the tests with `./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x`. +. Run the tests with `./gradlew check -Dbwc.remote=${remote} -Dbwc.refspec.5.x=index_req_bwc_5.x`. ==== Skip fetching latest diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index 649dd7ff8de..c3d3ac1ecb2 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -42,7 +42,7 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased File checkoutDir = file("${buildDir}/bwc/checkout-${bwcBranch}") - final String remote = System.getProperty("tests.bwc.remote", "elastic") + final String remote = System.getProperty("bwc.remote", "elastic") boolean gitFetchLatest final String gitFetchLatestProperty = System.getProperty("tests.bwc.git_fetch_latest", "true") @@ -103,8 +103,8 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased task checkoutBwcBranch() { dependsOn fetchLatest doLast { - String refspec = System.getProperty("tests.bwc.refspec.${bwcBranch}", "${remote}/${bwcBranch}") - if (System.getProperty("tests.bwc.checkout.align") != null) { + String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}" + if (System.getProperty("bwc.checkout.align") != null || System.getProperty("tests.bwc.checkout.align") != null) { /* We use a time based approach to make the bwc versions built deterministic and compatible with the current hash. Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting