Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

class VersionDownloadSource implements DownloadSource {

public static final String RELEASE_URL = "https://cdn.crate.io/downloads/releases/crate-%s.tar.gz";
public static final String RELEASE_PLATFORM_URL = "https://cdn.crate.io/downloads/releases/cratedb/%s/crate-%s.tar.gz";
public static final String NIGHTLY_URL = "https://cdn.crate.io/downloads/releases/nightly/crate-latest.tar.gz";
public static final String NIGHTLY_PLATFORM_URL = "https://cdn.crate.io/downloads/releases/nightly/%s/crate-latest.tar.gz";
Expand Down Expand Up @@ -76,9 +75,8 @@ static URL buildDownloadUrl(String version, String platform) throws MalformedURL
return new URL(String.format(Locale.ENGLISH, RELEASE_PLATFORM_URL, "x64_mac", version));
case AARCH64_LINUX:
case X64_WINDOWS:
return new URL(String.format(Locale.ENGLISH, RELEASE_PLATFORM_URL, platform, version));
case X64_LINUX:
return new URL(String.format(Locale.ENGLISH, RELEASE_URL, version));
return new URL(String.format(Locale.ENGLISH, RELEASE_PLATFORM_URL, platform, version));
default:
throw new MalformedURLException(String.format("Platform %s not supported", platform));
}
Expand Down
15 changes: 15 additions & 0 deletions src/test/java/io/crate/integrationtests/FromFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.junit.ClassRule;
import org.junit.Test;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;

import static io.crate.testing.Constants.CRATE_VERSION_FOR_TESTS;
Expand All @@ -39,6 +41,19 @@ public class FromFileTest extends BaseTest {

private static final String CLUSTER_NAME = "from-file";

private static final CrateTestCluster dummyCluster = CrateTestCluster
.fromVersion(CRATE_VERSION_FOR_TESTS)
.clusterName("dummy")
.build();

static {
try {
dummyCluster.prepareEnvironment();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}

private static final String FILE = FromFileTest.class
.getResource(String.format("crate-%s.tar.gz", CRATE_VERSION_FOR_TESTS))
.getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ public class FromLatestUrlTest extends BaseTest {

@ClassRule
public static CrateTestCluster fromUrlCluster = CrateTestCluster
.fromURL("https://cdn.crate.io/downloads/releases/nightly/crate-latest.tar.gz")
.fromVersion("latest")
.clusterName(CLUSTER_NAME)
.build();

@Before
public void setUp() throws MalformedURLException {
prepare(fromUrlCluster);
}

/**
* This test uses latest nightly build of crate and CrateDB 4.x requires JDK 11
* and so this might fail if you're using older version of JDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class MultipleDifferentCratesTest extends BaseTest {

private static final String CLUSTER_NAME_FIRST = "multiples-1";
private static final String CLUSTER_NAME_SECOND = "multiples-2";
private static final String FIRST_VERSION = "3.0.1";
private static final String SECOND_VERSION = "3.0.3";
private static final String FIRST_VERSION = "6.4.1";
private static final String SECOND_VERSION = "6.4.2";

@ClassRule
public static CrateTestCluster FIRST_CLUSTER = CrateTestCluster
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/crate/testing/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public final class Constants {

public static final String CRATE_VERSION_FOR_TESTS = "3.0.3";
public static final String CRATE_VERSION_FOR_TESTS = "6.4.2";
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static Collection<Object[]> data() {
{ "6.4.0", "x64_windows",
"https://cdn.crate.io/downloads/releases/cratedb/x64_windows/crate-6.4.0.tar.gz" },
{ "6.4.0", "x64_linux",
"https://cdn.crate.io/downloads/releases/crate-6.4.0.tar.gz" },
"https://cdn.crate.io/downloads/releases/cratedb/x64_linux/crate-6.4.0.tar.gz" },
{ "latest", "aarch64_mac",
"https://cdn.crate.io/downloads/releases/nightly/aarch64_mac/crate-latest.tar.gz" },
{ "latest", "aarch64_linux",
Expand Down
Loading