Skip to content

Commit

Permalink
[apache#1291] Improvement (trino-connector) Add TPC-H and TPC-DS test…
Browse files Browse the repository at this point in the history
… sets to trino-connector integration test (apache#1435)

### What changes were proposed in this pull request?

Add TPC-H and TPC-DS test set to trino-connector tester
Add Tester tools for run special test sets and tester.

### Why are the changes needed?

Fix: apache#1291

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

IT
  • Loading branch information
diqiu50 authored and mchades committed Jan 19, 2024
1 parent 5633379 commit 8f064c8
Show file tree
Hide file tree
Showing 322 changed files with 12,543 additions and 828 deletions.
2 changes: 2 additions & 0 deletions docs/how-to-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Deploy the Gravitino server locally to run the integration tests. Follow these s
in the `distribution` directory.
3. Use the `./gradlew test [--rerun-tasks] -PskipTests -PtestMode=deploy` command to run the
integration tests in the `distribution` directory.
4. Use the `bash integration-test/trino-test-tools/trino_test.sh` command to run all the
Trino test sets in the `integration-test/src/test/resources/trino-ci-testset/testsets` directory.

## Skip tests

Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ publish-plugin = '1.2.0'
rat-plugin = '0.8.0'
shadow-plugin = "8.1.1"
node-plugin = "3.1.0"
commons-cli = "1.2"

[libraries]
protobuf-java = { group = "com.google.protobuf", name = "protobuf-java", version.ref = "protoc" }
Expand Down Expand Up @@ -133,6 +134,7 @@ prometheus-servlet = { group = "io.prometheus", name = "simpleclient_servlet", v
jsqlparser = { group = "com.github.jsqlparser", name = "jsqlparser", version.ref = "jsqlparser" }
mysql-driver = { group = "mysql", name = "mysql-connector-java", version.ref = "mysql" }
postgresql-driver = { group = "org.postgresql", name = "postgresql", version.ref = "postgresql" }
commons-cli = { group = "commons-cli", name = "commons-cli", version.ref = "commons-cli" }

[bundles]
log4j = ["slf4j-api", "log4j-slf4j2-impl", "log4j-api", "log4j-core", "log4j-12-api"]
Expand Down
19 changes: 19 additions & 0 deletions integration-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.util.*

plugins {
`maven-publish`
`application`
id("java")
id("idea")
}
Expand Down Expand Up @@ -121,6 +122,7 @@ dependencies {
testImplementation(libs.okhttp3.loginterceptor)
testImplementation(libs.mysql.driver)
testImplementation(libs.postgresql.driver)
implementation(libs.commons.cli)
}

/* Optimizing integration test execution conditions */
Expand Down Expand Up @@ -307,3 +309,20 @@ tasks.test {
}
}
}

tasks.register<JavaExec>("TrinoTest") {
classpath = sourceSets["test"].runtimeClasspath
systemProperty("gravitino.log.path", buildDir.path + "/integration-test.log")
mainClass.set("com.datastrato.gravitino.integration.test.trino.TrinoQueryTestTool")

if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs = listOf(
"--add-opens",
"java.base/java.lang=ALL-UNNAMED"
)
}

if (project.hasProperty("appArgs")) {
args = (project.property("appArgs") as String).removeSurrounding("\"").split(" ")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -126,6 +127,11 @@ public void start() throws Exception {
Thread.sleep(500);
}
if (!started) {
try {
future.get(5, TimeUnit.SECONDS);
} catch (Exception e) {
throw new RuntimeException("Gravitino server start failed", e);
}
throw new RuntimeException("Can not start Gravitino server");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public void launch(int gravitinoServerPort) throws Exception {

Map<String, String> env = new HashMap<>();
env.put("GRAVITINO_SERVER_PORT", String.valueOf(gravitinoServerPort));
env.put("GRAVITINO_LOG_PATH", System.getProperty("gravitino.log.path"));
if (System.getProperty("gravitino.log.path") != null) {
env.put("GRAVITINO_LOG_PATH", System.getProperty("gravitino.log.path"));
}

String command = ITUtils.joinPath(dockerComposeDir, "launch.sh");
Object output =
Expand Down
Loading

0 comments on commit 8f064c8

Please sign in to comment.