Skip to content

Commit 88cff72

Browse files
committed
test older server
1 parent 775028d commit 88cff72

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/test_cluster.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
version:
18+
- "nightly"
19+
- "v1.2.790-nightly"
1420
steps:
1521
- uses: actions/checkout@v4
1622

@@ -26,9 +32,12 @@ jobs:
2632
- name: Start Cluster With Nginx and Minio
2733
working-directory: tests
2834
run: make up
35+
env:
36+
DATABEND_QUERY_VERSION: ${{ matrix.version }}
2937

3038
- name: Test with conn to nginx
3139
run: mvn test -DexcludedGroups=FLAKY
3240
env:
3341
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3442
DATABEND_TEST_CONN_PORT: 8000
43+
DATABEND_QUERY_VERSION: ${{ matrix.version }}

databend-jdbc/src/test/java/com/databend/jdbc/Compatibility.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
import com.vdurmont.semver4j.Semver;
44

5-
import java.sql.Connection;
6-
import java.sql.DriverManager;
7-
import java.sql.SQLException;
8-
import java.util.Properties;
9-
105
public class Compatibility {
116
public static class Capability {
127
boolean streamingLoad;
@@ -19,35 +14,34 @@ public Capability(boolean streamingLoad) {
1914
}
2015

2116
public static Capability fromServerVersion(Semver ver) {
22-
boolean streamingLoad = ver.isGreaterThan(new Semver("1.2.781"));
17+
boolean streamingLoad = ver.isGreaterThanOrEqualTo(new Semver("1.2.792"));
2318
return new Capability(streamingLoad);
2419
}
2520

2621
public static Capability fromDriverVersion(Semver ver) {
27-
boolean streamingLoad = ver.isGreaterThan(new Semver("0.4.1"));
22+
boolean streamingLoad = ver.isGreaterThanOrEqualTo(new Semver("0.4.1"));
2823
return new Capability(streamingLoad);
2924
}
3025
}
3126

32-
static String port = System.getenv("DATABEND_TEST_CONN_PORT") != null ? System.getenv("DATABEND_TEST_CONN_PORT").trim() : "8000";
3327
public static Semver driverVersion = getDriverVersion();
3428
public static Semver serverVersion = getServerVersion();
3529
public static Capability driverCapability = driverVersion==null? new Capability(): Capability.fromDriverVersion(driverVersion);
3630
public static Capability serverCapability = serverVersion==null? new Capability(): Capability.fromServerVersion(serverVersion);
3731

3832
private static Semver getDriverVersion() {
39-
String env = System.getenv("DATABEND_TEST_DRIVER_VERSION");
33+
String env = System.getenv("DRIVER_VERSION");
4034
if (env == null) {
4135
return null;
4236
}
4337
return new Semver(env);
4438
}
4539
private static Semver getServerVersion() {
46-
String env = System.getenv("DATABEND_TEST_SERVER_VERSION");
47-
if (env == null) {
40+
String env = System.getenv("DATABEND_QUERY_VERSION");
41+
if (env == null || "nightly".equals(env)) {
4842
return null;
4943
}
50-
return new Semver(env);
44+
return new Semver(env).withClearedSuffixAndBuild();
5145
}
5246

5347
public static boolean skipDriverBug(String version) {

0 commit comments

Comments
 (0)