From 44c3d5b3d930d52baae3246467dcecf951a9aef8 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 21 Aug 2017 09:59:45 +0200 Subject: [PATCH] Allow to change bwc refspec in xpack (elastic/x-pack-elasticsearch#2311) Today it's impossible to run xpack bwc tests against any other branch or remote than upstream. This allows to pass `-Dtests.bwc.refspec` to change the refspec to use for the bwc tests. Original commit: elastic/x-pack-elasticsearch@4d365f5a6e0acb5ef7923b8f265e03bbe8c4524f --- plugin/bwc/build.gradle | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/bwc/build.gradle b/plugin/bwc/build.gradle index 1d283ab423a..478dc5cd3c6 100644 --- a/plugin/bwc/build.gradle +++ b/plugin/bwc/build.gradle @@ -117,25 +117,27 @@ subprojects { task fetchElasticsearchLatest(type: LoggedExec) { dependsOn addElasticsearchUpstream workingDir = esCheckoutDir - commandLine = ['git', 'fetch', 'upstream'] + commandLine = ['git', 'fetch', '--all'] } task fetchXPackLatest(type: LoggedExec) { dependsOn addXPackUpstream workingDir = xpackCheckoutDir - commandLine = ['git', 'fetch', 'upstream'] + commandLine = ['git', 'fetch', '--all'] } task checkoutElasticsearchBwcBranch(type: LoggedExec) { dependsOn fetchElasticsearchLatest + def String refspec = System.getProperty("tests.bwc.refspec", "upstream/${bwcBranch}") workingDir = esCheckoutDir - commandLine = ['git', 'checkout', "upstream/${bwcBranch}"] + commandLine = ['git', 'checkout', refspec] } task checkoutXPackBwcBranch(type: LoggedExec) { dependsOn fetchXPackLatest + def String refspec = System.getProperty("tests.bwc.refspec", "upstream/${bwcBranch}") workingDir = xpackCheckoutDir - commandLine = ['git', 'checkout', "upstream/${bwcBranch}"] + commandLine = ['git', 'checkout', refspec] } File bwcZip = file("${xpackCheckoutDir}/plugin/build/distributions/x-pack-${bwcVersion}.zip")