Skip to content

Commit

Permalink
Migrate all integration tests to JUnit Jupiter / TestContainers (#797)
Browse files Browse the repository at this point in the history
* Migrate all integration tests to JUnit Jupiter / TestContainers

Signed-off-by: Jeroen van Erp <jeroen@hierynomus.com>

* Update dependencies due to Snyk CVE detection

---------

Signed-off-by: Jeroen van Erp <jeroen@hierynomus.com>
  • Loading branch information
hierynomus committed Sep 25, 2023
1 parent 5a7766a commit a50bc41
Show file tree
Hide file tree
Showing 17 changed files with 1,165 additions and 1,075 deletions.
67 changes: 0 additions & 67 deletions build-android.gradle

This file was deleted.

34 changes: 9 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ plugins {
id "signing"
id 'pl.allegro.tech.build.axion-release' version '1.15.3'
id "com.github.hierynomus.license" version "0.16.1"
id "com.bmuschko.docker-remote-api" version "9.2.1"
// id 'ru.vyarus.java-lib' version '2.1.0'
id 'ru.vyarus.github-info' version '1.5.0'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
Expand Down Expand Up @@ -98,6 +97,7 @@ testing {
implementation SPOCK_CORE
implementation COMMONS_IO
implementation "org.mockito:mockito-core:5.4.0"
implementation "org.assertj:assertj-core:3.24.2"
runtimeOnly LOGBACK_CLASSIC
}

Expand All @@ -122,6 +122,14 @@ testing {
}

integrationTest(JvmTestSuite) {
dependencies {
implementation project()
implementation "ch.qos.logback:logback-classic:1.3.8"
implementation 'org.testcontainers:testcontainers:1.19.0'
implementation 'org.testcontainers:junit-jupiter:1.19.0'
implementation 'org.apache.commons:commons-compress:1.24.0'
}

sources {
java {
srcDirs = ['src/it/java']
Expand Down Expand Up @@ -222,30 +230,6 @@ jacocoTestReport {
}
}

task buildItestImage(type: DockerBuildImage) {
inputDir = file('src/it/docker-image')
images.add('smbj/smbj-itest:latest')
}

task createItestContainer(type: DockerCreateContainer) {
dependsOn buildItestImage
targetImageId buildItestImage.getImageId()
hostConfig.portBindings = ['445:445']
hostConfig.autoRemove = true
}

task startItestContainer(type: DockerStartContainer) {
dependsOn createItestContainer
targetContainerId createItestContainer.getContainerId()
}

task stopItestContainer(type: DockerStopContainer) {
targetContainerId createItestContainer.getContainerId()
}

project.tasks.integrationTest.dependsOn(startItestContainer)
project.tasks.integrationTest.finalizedBy(stopItestContainer)

project.tasks.release.dependsOn([project.tasks.integrationTest, project.tasks.build])

project.tasks.jacocoTestReport.dependsOn(project.tasks.test)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ COMMONS_IO=commons-io:commons-io:2.13.0
LOGBACK_CLASSIC=ch.qos.logback:logback-classic:1.3.8
MBASSADOR=net.engio:mbassador:1.3.0
OBJENESIS=org.objenesis:objenesis:3.3
SLF4J_API=org.slf4j:slf4j-api:2.0.7
SLF4J_API=org.slf4j:slf4j-api:2.0.9
SPOCK_CORE=org.spockframework:spock-core:2.3-groovy-3.0
ASN_ONE=com.hierynomus:asn-one:0.6.0
115 changes: 0 additions & 115 deletions src/it/groovy/com/hierynomus/smbj/DfsIntegrationSpec.groovy

This file was deleted.

Loading

0 comments on commit a50bc41

Please sign in to comment.