You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add more transport version validation cases (#134597)
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id
Also fixed definition path output in some validation error messages.
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/AbstractTransportVersionFuncTest.groovy
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -126,8 +126,9 @@ class AbstractTransportVersionFuncTest extends AbstractGradleFuncTest {
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/TransportVersionGenerationFuncTest.groovy
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -357,7 +357,7 @@ class TransportVersionGenerationFuncTest extends AbstractTransportVersionFuncTes
357
357
assertUpperBound("9.2", "new_tv,8123100")
358
358
}
359
359
360
-
def"an invalid increment should fail"() {
360
+
def"a non-positive increment should fail"() {
361
361
given:
362
362
referencedTransportVersion("new_tv")
363
363
@@ -368,6 +368,17 @@ class TransportVersionGenerationFuncTest extends AbstractTransportVersionFuncTes
368
368
assertOutputContains(result.output, "Invalid increment 0, must be a positive integer")
369
369
}
370
370
371
+
def"an increment larger than 1000 should fail"() {
372
+
given:
373
+
referencedTransportVersion("new_tv")
374
+
375
+
when:
376
+
def result = runGenerateTask("--increment=1001").buildAndFail()
377
+
378
+
then:
379
+
assertOutputContains(result.output, "Invalid increment 1001, must be no larger than 1000")
380
+
}
381
+
371
382
def"a new definition exists and is in the latest file, but the version id is wrong and needs to be updated"(){
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/TransportVersionValidationFuncTest.groovy
+34-9Lines changed: 34 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,17 @@ class TransportVersionValidationFuncTest extends AbstractTransportVersionFuncTes
118
118
def result = validateResourcesFails()
119
119
then:
120
120
assertValidateResourcesFailure(result, "Transport version definition file "+
121
-
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv] modifies existing patch id from 8012001 to 8012002")
121
+
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv] has modified patch id from 8012001 to 8012002")
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateInitialTransportVersionTask.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -52,8 +52,8 @@ public void run() throws IOException {
52
52
// minors increment by 1000 to create a unique base, patches increment by 1 as other patches do
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateTransportVersionDefinitionTask.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ public void run() throws IOException {
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionDefinition.java
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionResourcesService.java
0 commit comments