|
9 | 9 |
|
10 | 10 | package org.elasticsearch.test.index; |
11 | 11 |
|
12 | | -import org.elasticsearch.index.IndexVersion; |
13 | 12 | import org.elasticsearch.index.IndexVersions; |
14 | 13 | import org.elasticsearch.test.ESTestCase; |
15 | 14 |
|
|
19 | 18 | import java.util.List; |
20 | 19 | import java.util.Set; |
21 | 20 |
|
| 21 | +import static org.hamcrest.Matchers.equalTo; |
| 22 | + |
22 | 23 | public class IndexVersionUtilsTests extends ESTestCase { |
23 | 24 | /** |
24 | 25 | * Tests that {@link IndexVersions#MINIMUM_COMPATIBLE} and {@link IndexVersionUtils#allReleasedVersions()} |
25 | | - * agree with the list of index compatible versions we build in gradle. |
| 26 | + * agree on the minimum version that should be tested. |
26 | 27 | */ |
27 | | - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/98054") |
28 | | - public void testGradleVersionsMatchVersionUtils() { |
| 28 | + public void testIndexCompatibleVersionMatches() { |
29 | 29 | VersionsFromProperty indexCompatible = new VersionsFromProperty("tests.gradle_index_compat_versions"); |
30 | | - List<IndexVersion> released = IndexVersionUtils.allReleasedVersions() |
31 | | - .stream() |
32 | | - /* Java lists all versions from the 5.x series onwards, but we only want to consider |
33 | | - * ones that we're supposed to be compatible with. */ |
34 | | - .filter(v -> v.onOrAfter(IndexVersions.MINIMUM_COMPATIBLE)) |
35 | | - .toList(); |
36 | 30 |
|
37 | | - List<String> releasedIndexCompatible = released.stream() |
38 | | - .filter(v -> IndexVersion.current().equals(v) == false) |
39 | | - .map(Object::toString) |
40 | | - .toList(); |
41 | | - assertEquals(releasedIndexCompatible, indexCompatible.released); |
| 31 | + String minIndexVersion = IndexVersions.MINIMUM_COMPATIBLE.toReleaseVersion(); |
| 32 | + String lowestCompatibleVersion = indexCompatible.released.get(0); |
| 33 | + assertThat(lowestCompatibleVersion, equalTo(minIndexVersion)); |
42 | 34 | } |
43 | 35 |
|
44 | 36 | /** |
|
0 commit comments