Skip to content

Commit

Permalink
Merge pull request #268 from ClickHouse/add-chaos-testing
Browse files Browse the repository at this point in the history
Add chaos testing
  • Loading branch information
Paultagoras authored Dec 4, 2023
2 parents 4624eec + 9e63a47 commit c515221
Show file tree
Hide file tree
Showing 32 changed files with 2,078 additions and 1,964 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Integration Tests

on: [workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Mask secure properties
run: |
echo "::add-mask::${{ secrets.CLICKHOUSE_PASSWORD }}"
echo "::add-mask::${{ secrets.CLICKHOUSE_CLOUD_SECRET }}"
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
architecture: x64
- name: Setup and execute Gradle 'integrationTest' task
uses: gradle/gradle-build-action@v2
with:
arguments: integrationTest --info -D clickhouse.host="${{vars.CLICKHOUSE_HOST}}" -D clickhouse.port="${{vars.CLICKHOUSE_PORT}}" -D clickhouse.password="${{secrets.CLICKHOUSE_PASSWORD}}" -D clickhouse.cloud.organization="${{vars.CLICKHOUSE_CLOUD_ORGANIZATION}}" -D clickhouse.cloud.id="${{vars.CLICKHOUSE_CLOUD_ID}}" -D clickhouse.cloud.secret="${{secrets.CLICKHOUSE_CLOUD_SECRET}}" -D clickhouse.cloud.serviceId="${{vars.CLICKHOUSE_CLOUD_SERVICE_ID}}" -D clickhouse.cloud.host="${{vars.CLICKHOUSE_CLOUD_API_HOST}}"
26 changes: 5 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ dependencies {
// IntegrationTests
testImplementation("org.testcontainers:clickhouse:1.19.1")
testImplementation("org.testcontainers:kafka:1.19.1")
testImplementation("com.clickhouse:clickhouse-jdbc:${project.extra["clickHouseDriverVersion"]}:all")
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("org.json:json:20231013")
testImplementation("org.testcontainers:toxiproxy:1.19.1")
testImplementation("org.apache.httpcomponents.client5:httpclient5:5.2.1")
testImplementation("com.clickhouse:clickhouse-jdbc:${project.extra["clickHouseDriverVersion"]}:all")
testImplementation("com.clickhouse:clickhouse-client:${project.extra["clickHouseDriverVersion"]}")
testImplementation("com.clickhouse:clickhouse-http-client:${project.extra["clickHouseDriverVersion"]}")

}

Expand All @@ -127,25 +130,10 @@ tasks.create("integrationTest", Test::class.java) {
outputs.upToDateWhen { false }
dependsOn("prepareConfluentArchive")
mustRunAfter("test")
systemProperties = System.getProperties() as Map<String, Any>
}


sourceSets.create("exactlyOnceTest") {
java.srcDir("src/exactlyOnceTest/java")
compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"]
runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath
}
tasks.create("exactlyOnceTest", Test::class.java) {
description = "Runs the exactly once tests"
group = "verification"
testClassesDirs = sourceSets["exactlyOnceTest"].output.classesDirs
classpath = sourceSets["exactlyOnceTest"].runtimeClasspath
outputs.upToDateWhen { false }
dependsOn("prepareConfluentArchive")
mustRunAfter("test")
testLogging.showStandardStreams = true
}

tasks.withType<Test> {
tasks.getByName("check").dependsOn(this)
systemProperty("file.encoding", "windows-1252") // run tests with different encoding
Expand Down Expand Up @@ -253,7 +241,3 @@ tasks.register<Zip>("createConfluentArchive") {
archiveVersion.set(project.version.toString())
destinationDirectory.set(file("$buildDir/confluent"))
}

tasks.getByName("integrationTest") {
onlyIf{ System.getenv("HOST") != null && System.getenv("PORT") != null && System.getenv("PASSWORD") != null}
}
324 changes: 0 additions & 324 deletions src/exactlyOnceTest/java/com/clickhouse/ExactlyOnceTest.java

This file was deleted.

Loading

0 comments on commit c515221

Please sign in to comment.