From 52c283cdeed8c7cc1974d010348f1b240e069131 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 15 Mar 2016 14:15:41 +0100 Subject: [PATCH] [TEST] Add test that ensures we never bump the minor version of lucene in a bugfix release --- .../java/org/elasticsearch/VersionTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/VersionTests.java b/core/src/test/java/org/elasticsearch/VersionTests.java index eec912989a7..17a41c30275 100644 --- a/core/src/test/java/org/elasticsearch/VersionTests.java +++ b/core/src/test/java/org/elasticsearch/VersionTests.java @@ -260,4 +260,20 @@ public class VersionTests extends ESTestCase { } } + // this test ensures we never bump the lucene version in a bugfix release + public void testLuceneVersionIsSameOnMinorRelease() { + for (Version version : VersionUtils.allVersions()) { + for (Version other : VersionUtils.allVersions()) { + if (other.onOrAfter(version)) { + assertTrue("lucene versions must be " + other + " >= " + version, + other.luceneVersion.onOrAfter(version.luceneVersion)); + } + if (other.major == version.major && other.minor == version.minor) { + assertEquals(other.luceneVersion.major, version.luceneVersion.major); + assertEquals(other.luceneVersion.minor, version.luceneVersion.minor); + // should we also assert the lucene bugfix version? + } + } + } + } }