Skip to content
Open
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
2 changes: 1 addition & 1 deletion zoe-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FROM adoptopenjdk:11-jre-openj9
FROM eclipse-temurin:21-jre-alpine

ENV ZOE_INSTALL_DIR=/zoe
ENV ZOE_JAR_PATH=${ZOE_INSTALL_DIR}/lib/zoe-cli-final.jar
Expand Down
7 changes: 4 additions & 3 deletions zoe-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ dependencies {
implementation("log4j:log4j:1.2.17")

testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.2.0")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.2.0")
testImplementation("io.kotest:kotest-property-jvm:4.2.0")
testImplementation("io.kotest:kotest-runner-junit5-jvm:5.9.1")
testImplementation("io.kotest:kotest-assertions-core-jvm:5.9.1")
testImplementation("io.kotest:kotest-property-jvm:5.9.1")
testImplementation(platform("org.testcontainers:testcontainers-bom:1.20.3")) //import bom
testImplementation("org.testcontainers:testcontainers")
testImplementation("com.google.cloud.tools:jib-core:0.27.3")
testImplementation("org.testcontainers:kafka")
}
39 changes: 39 additions & 0 deletions zoe-cli/test/com/adevinta/oss/zoe/cli/containerTests.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.adevinta.oss.zoe.cli

import io.kotest.core.spec.style.ExpectSpec
import io.kotest.matchers.shouldBe
import org.testcontainers.containers.GenericContainer
import java.nio.file.Paths

class ContainerTests : ExpectSpec({
context("Build and test container") {
context("Build container") {
val rootDirectory = Paths.get(System.getProperty("user.dir"), "..").toFile()

val process = ProcessBuilder("./gradlew", "zoe-cli:jibDockerBuild")
.directory(rootDirectory)
.inheritIO()
.start()

expect("Build process to finish") {
val exitCode = process.waitFor()
exitCode shouldBe 0
}
}

context("Test container config command") {
val container = GenericContainer("adevinta/zoe-cli")
.withCommand("config", "environments", "list")

expect("Container to start and run") {
container.use {
container.start()
while (container.isRunning) {
Thread.sleep(100)
}
container.logs shouldBe "[]\n"
}
}
}
}
})
2 changes: 1 addition & 1 deletion zoe-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {

testImplementation(group = "junit", name = "junit", version = "4.12")

testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.10")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.19")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:2.0.10")

// spek requires kotlin-reflect, can be omitted if already in the classpath
Expand Down
4 changes: 2 additions & 2 deletions zoe-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ dependencies {
testImplementation("org.testcontainers:testcontainers:1.20.3")
testImplementation("org.testcontainers:kafka:1.20.3")

testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.10")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:2.0.10")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.19")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:2.0.19")
}

tasks {
Expand Down