浏览代码

Fix branch logic for bwc tests in the same major version (#25134)

When testing against the previous 5.x release, the bwc project incorrectly would checkout the 5.x
branch instead of the 5.5 branch as it still had the logic that applies for major versions bwc. This change adds
a check to compare the major version when making the decision on the branch to use.
jaymode 8 年之前
父节点
当前提交
bf007e8d93
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      distribution/bwc/build.gradle

+ 9 - 2
distribution/bwc/build.gradle

@@ -51,8 +51,15 @@ if (enabled) {
   apply plugin: 'distribution'
 
   def (String major, String minor, String bugfix) = bwcVersion.split('\\.')
-  String bwcBranch =
-      project.name == 'bwc-stable-snapshot' ? "${major}.x" : "${major}.${minor}"
+  def (String currentMajor, String currentMinor, String currentBugfix) = version.split('\\.')
+  String bwcBranch
+  if (project.name == 'bwc-stable-snapshot') {
+    bwcBranch = "${major}.x"
+  } else if (major != currentMajor) {
+    bwcBranch = "${major}.x"
+  } else {
+    bwcBranch = "${major}.${minor}"
+  }
   File checkoutDir = file("${buildDir}/bwc/checkout-${bwcBranch}")
 
   task createClone(type: LoggedExec) {