Skip to content

Commit d0c7c65

Browse files
authored
Ensure we verify versioned dir for es bwc builds (#66590)
Update according integ tests
1 parent 77a59ad commit d0c7c65

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGitAwareGradleF
110110
inputs.files(configurations.expandedDist)
111111
doLast {
112112
configurations.expandedDist.files.each {
113-
println "distfile " + (it.absolutePath - project.rootDir.absolutePath)
113+
println "expandedRootPath " + (it.absolutePath - project.rootDir.absolutePath)
114+
it.eachFile { nested ->
115+
println "nested folder " + (nested.absolutePath - project.rootDir.absolutePath)
116+
}
114117
}
115118
}
116119
}
@@ -123,11 +126,13 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGitAwareGradleF
123126
then:
124127
result.task(":resolveExpandedDistribution").outcome == TaskOutcome.SUCCESS
125128
result.task(":distribution:bwc:minor:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS
126-
127129
and: "assemble task triggered"
128130
result.output.contains("[7.11.0] > Task :distribution:archives:darwin-tar:extractedAssemble")
129131
normalized(result.output)
130-
.contains("distfile /distribution/bwc/minor/build/bwc/checkout-7.x/" +
132+
.contains("expandedRootPath /distribution/bwc/minor/build/bwc/checkout-7.x/" +
131133
"distribution/archives/darwin-tar/build/install")
134+
normalized(result.output)
135+
.contains("nested folder /distribution/bwc/minor/build/bwc/checkout-7.x/" +
136+
"distribution/archives/darwin-tar/build/install/elasticsearch-7.11.0-SNAPSHOT")
132137
}
133138
}

buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ static void createBuildBwcTask(
213213
String bwcTaskName = buildBwcTaskName(projectName);
214214
bwcSetupExtension.bwcTask(bwcTaskName, c -> {
215215
boolean useNativeExpanded = projectArtifact.expandedDistDir != null;
216-
File expectedOutputFile = useNativeExpanded ? projectArtifact.expandedDistDir : projectArtifact.distFile;
216+
File expectedOutputFile = useNativeExpanded
217+
? new File(projectArtifact.expandedDistDir, "elasticsearch-" + bwcVersion.get() + "-SNAPSHOT")
218+
: projectArtifact.distFile;
217219
c.getInputs().file(new File(project.getBuildDir(), "refspec"));
218220
if (useNativeExpanded) {
219221
c.getOutputs().dir(expectedOutputFile);
@@ -279,7 +281,7 @@ private static class DistributionProject {
279281
+ "."
280282
+ extension
281283
),
282-
expandedDistDirSupport ? new File(checkoutDir, baseDir + "/" + name + "/build/install/") : null
284+
expandedDistDirSupport ? new File(checkoutDir, baseDir + "/" + name + "/build/install") : null
283285
);
284286
}
285287

0 commit comments

Comments
 (0)