Tests: Move static bwc indexes to a shared location
There are a few tests that currently use the statically generated backcompat indexes. This change moves them to a shared location, so they no longer have to build a path based on the package name of the old index tests.
This commit is contained in:
parent
b18ee60f80
commit
8f75c2b3a8
|
@ -98,7 +98,7 @@ public class OldIndexBackwardsCompatibilityIT extends ESIntegTestCase {
|
|||
|
||||
private List<String> loadIndexesList(String prefix) throws IOException {
|
||||
List<String> indexes = new ArrayList<>();
|
||||
Path dir = getDataPath(".");
|
||||
Path dir = getDataPath("/indices/bwc");
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, prefix + "-*.zip")) {
|
||||
for (Path path : stream) {
|
||||
indexes.add(path.getFileName().toString());
|
||||
|
|
|
@ -129,7 +129,7 @@ public class RestoreBackwardsCompatIT extends AbstractSnapshotIntegTestCase {
|
|||
}
|
||||
|
||||
private Path reposRoot() {
|
||||
return getDataPath(".");
|
||||
return getDataPath("/indices/bwc");
|
||||
}
|
||||
|
||||
private List<String> repoVersions() throws Exception {
|
||||
|
@ -155,7 +155,7 @@ public class RestoreBackwardsCompatIT extends AbstractSnapshotIntegTestCase {
|
|||
}
|
||||
|
||||
private void createRepo(String prefix, String version, String repo) throws Exception {
|
||||
String repoFile = prefix + "-" + version + ".zip";
|
||||
String repoFile = "/indices/bwc/" + prefix + "-" + version + ".zip";
|
||||
URI repoFileUri = getDataPath(repoFile).toUri();
|
||||
URI repoJarUri = new URI("jar:" + repoFileUri.toString() + "!/repo/");
|
||||
logger.info("--> creating repository [{}] for version [{}]", repo, version);
|
||||
|
|
|
@ -133,7 +133,7 @@ public class MultiDataPathUpgraderTests extends ESTestCase {
|
|||
*/
|
||||
public void testUpgradeRealIndex() throws IOException, URISyntaxException {
|
||||
List<Path> indexes = new ArrayList<>();
|
||||
Path dir = getDataPath("/" + OldIndexBackwardsCompatibilityIT.class.getPackage().getName().replace('.', '/')); // the files are in the same pkg as the OldIndexBackwardsCompatibilityTests test
|
||||
Path dir = getDataPath("/indices/bwc");
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "index-*.zip")) {
|
||||
for (Path path : stream) {
|
||||
indexes.add(path);
|
||||
|
|
|
@ -1786,7 +1786,7 @@ public class InternalEngineTests extends ESTestCase {
|
|||
|
||||
public void testUpgradeOldIndex() throws IOException {
|
||||
List<Path> indexes = new ArrayList<>();
|
||||
Path dir = getDataPath("/" + OldIndexBackwardsCompatibilityIT.class.getPackage().getName().replace('.', '/')); // the files are in the same pkg as the OldIndexBackwardsCompatibilityTests test
|
||||
Path dir = getDataPath("/indices/bwc");
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "index-*.zip")) {
|
||||
for (Path path : stream) {
|
||||
indexes.add(path);
|
||||
|
|
|
@ -1157,7 +1157,7 @@ public class TranslogTests extends ESTestCase {
|
|||
|
||||
public void testUpgradeOldTranslogFiles() throws IOException {
|
||||
List<Path> indexes = new ArrayList<>();
|
||||
Path dir = getDataPath("/" + OldIndexBackwardsCompatibilityIT.class.getPackage().getName().replace('.', '/')); // the files are in the same pkg as the OldIndexBackwardsCompatibilityTests test
|
||||
Path dir = getDataPath("/indices/bwc");
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "index-*.zip")) {
|
||||
for (Path path : stream) {
|
||||
indexes.add(path);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue