Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chaos testing #268

Merged
merged 6 commits into from
Dec 4, 2023
Merged
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
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}}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added integration tests how long it take to run them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think last time it took 45 minutes - I'll run them again and see how long it takes. GitHub has a timeout of 6 hours apparently so we should be ok from that perspective (it's still a while, but with manual triggering it shouldn't block us solving an issue if needed and still allows us to verify if needed)

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