Skip to content

Commit d437e80

Browse files
committed
Build: Use branch specific refspec sysprop for bwc builds (#29299)
This commit changes the sysprop for overriding the branch bwc builds use to be branch specific. There are 3 different bwc branches built, but all of them currently read the exact same sysprop. For example, with this change and current branches, you can now specify eg `-Dtests.bwc.refspec.6.x=my_6x` and it will build only next-minor-snapshot with that branch, while next-bugfix-snapshot will continue to use 5.6.
1 parent 691b570 commit d437e80

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

TESTING.asciidoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,12 @@ branch. Finally, on a release branch, it will test against the most recent relea
476476
=== BWC Testing against a specific remote/branch
477477

478478
Sometimes a backward compatibility change spans two versions. A common case is a new functionality
479-
that needs a BWC bridge in and an unreleased versioned of a release branch (for example, 5.x).
479+
that needs a BWC bridge in an unreleased versioned of a release branch (for example, 5.x).
480480
To test the changes, you can instruct Gradle to build the BWC version from a another remote/branch combination instead of
481-
pulling the release branch from GitHub. You do so using the `tests.bwc.remote` and `tests.bwc.refspec` system properties:
481+
pulling the release branch from GitHub. You do so using the `tests.bwc.remote` and `tests.bwc.refspec.BRANCH` system properties:
482482

483483
-------------------------------------------------
484-
./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec=index_req_bwc_5.x
484+
./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x
485485
-------------------------------------------------
486486

487487
The branch needs to be available on the remote that the BWC makes of the
@@ -496,7 +496,7 @@ will need to:
496496
will contain your change.
497497
. Create a branch called `index_req_bwc_5.x` off `5.x`. This will contain your bwc layer.
498498
. Push both branches to your remote repository.
499-
. Run the tests with `./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec=index_req_bwc_5.x`.
499+
. Run the tests with `./gradlew check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec.5.x=index_req_bwc_5.x`.
500500

501501
== Test coverage analysis
502502

distribution/bwc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ subprojects {
9191

9292
String buildMetadataKey = "bwc_refspec_${project.path.substring(1)}"
9393
task checkoutBwcBranch(type: LoggedExec) {
94-
String refspec = System.getProperty("tests.bwc.refspec", buildMetadata.get(buildMetadataKey, "${remote}/${bwcBranch}"))
94+
String refspec = System.getProperty("tests.bwc.refspec.${bwcBranch}", buildMetadata.get(buildMetadataKey, "${remote}/${bwcBranch}"))
9595
dependsOn fetchLatest
9696
workingDir = checkoutDir
9797
commandLine = ['git', 'checkout', refspec]

0 commit comments

Comments
 (0)