Skip to content

Commit ad8ce0d

Browse files
committed
Rename system property to change bwc checkout behavior (#45574)
1 parent e012a18 commit ad8ce0d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

TESTING.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,10 @@ When running `./gradlew check`, minimal bwc checks are also run against compatib
565565
Sometimes a backward compatibility change spans two versions. A common case is a new functionality
566566
that needs a BWC bridge in an unreleased versioned of a release branch (for example, 5.x).
567567
To test the changes, you can instruct Gradle to build the BWC version from a another remote/branch combination instead of
568-
pulling the release branch from GitHub. You do so using the `tests.bwc.remote` and `tests.bwc.refspec.BRANCH` system properties:
568+
pulling the release branch from GitHub. You do so using the `bwc.remote` and `bwc.refspec.BRANCH` system properties:
569569

570570
-------------------------------------------------
571-
./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x
571+
./gradlew check -Dbwc.remote=${remote} -Dbwc.refspec.5.x=index_req_bwc_5.x
572572
-------------------------------------------------
573573

574574
The branch needs to be available on the remote that the BWC makes of the
@@ -583,7 +583,7 @@ will need to:
583583
will contain your change.
584584
. Create a branch called `index_req_bwc_5.x` off `5.x`. This will contain your bwc layer.
585585
. Push both branches to your remote repository.
586-
. Run the tests with `./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x`.
586+
. Run the tests with `./gradlew check -Dbwc.remote=${remote} -Dbwc.refspec.5.x=index_req_bwc_5.x`.
587587

588588
==== Skip fetching latest
589589

distribution/bwc/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
4242

4343
File checkoutDir = file("${buildDir}/bwc/checkout-${bwcBranch}")
4444

45-
final String remote = System.getProperty("tests.bwc.remote", "elastic")
45+
final String remote = System.getProperty("bwc.remote", "elastic")
4646

4747
boolean gitFetchLatest
4848
final String gitFetchLatestProperty = System.getProperty("tests.bwc.git_fetch_latest", "true")
@@ -103,8 +103,8 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
103103
task checkoutBwcBranch() {
104104
dependsOn fetchLatest
105105
doLast {
106-
String refspec = System.getProperty("tests.bwc.refspec.${bwcBranch}", "${remote}/${bwcBranch}")
107-
if (System.getProperty("tests.bwc.checkout.align") != null) {
106+
String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}"
107+
if (System.getProperty("bwc.checkout.align") != null || System.getProperty("tests.bwc.checkout.align") != null) {
108108
/*
109109
We use a time based approach to make the bwc versions built deterministic and compatible with the current hash.
110110
Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting

0 commit comments

Comments
 (0)