Skip to content

Commit 0d120ba

Browse files
committed
Allow version 0.0.0 for tests
Need to keep allowing that for serverless tests that doesn't know the version for the detached version distribution when registering the BwC test tasks.
1 parent 6017bc7 commit 0d120ba

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

build-tools/src/main/java/org/elasticsearch/gradle/Version.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ public static Version fromString(final String s, final Mode mode) {
7979
String revision = matcher.group(3);
8080
String qualifier = matcher.group(4);
8181

82-
if (major.equals("0") && minor.equals("0") && revision.equals("0")) {
83-
throw new IllegalArgumentException("Version 0.0.0 is not allowed");
84-
}
85-
8682
return new Version(Integer.parseInt(major), Integer.parseInt(minor), revision == null ? 0 : Integer.parseInt(revision), qualifier);
8783
}
8884

build-tools/src/test/groovy/org/elasticsearch/gradle/VersionSpec.groovy

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ class VersionSpec extends Specification {
7676
then:
7777
e = thrown(IllegalArgumentException)
7878
assert e.message == "Invalid version format: 'foo.bar.baz'. Should be major.minor.revision[-(alpha|beta|rc)Number|-SNAPSHOT]"
79-
80-
when:
81-
Version.fromString("0.0.0")
82-
then:
83-
e = thrown(IllegalArgumentException)
84-
assert e.message == "Version 0.0.0 is not allowed"
8579
}
8680

8781
def "handles qualifier"() {

0 commit comments

Comments
 (0)