v0.8.8-SNAPSHOT - refactor test package in TestSetup.kt
This commit is contained in:
parent
0f23e49935
commit
4587938e0b
5 changed files with 11 additions and 7 deletions
|
@ -16,7 +16,7 @@ apply plugin: 'java-test-fixtures'
|
||||||
|
|
||||||
|
|
||||||
group = 'io.provs'
|
group = 'io.provs'
|
||||||
version = '0.8.7-SNAPSHOT'
|
version = '0.8.8-SNAPSHOT'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.provs
|
package io.provs
|
||||||
|
|
||||||
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.CONTAINERTEST
|
import io.provs.test.tags.CONTAINERTEST
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.provs
|
package io.provs
|
||||||
|
|
||||||
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.CONTAINERTEST
|
import io.provs.test.tags.CONTAINERTEST
|
||||||
import org.junit.jupiter.api.Assertions
|
import org.junit.jupiter.api.Assertions
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package io.provs.processors
|
package io.provs.processors
|
||||||
|
|
||||||
import io.provs.DEFAULT_START_MODE_TEST_CONTAINER
|
import io.provs.test.DEFAULT_START_MODE_TEST_CONTAINER
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.platforms.SHELL
|
||||||
import io.provs.testDockerWithSudo
|
import io.provs.test.testDockerWithSudo
|
||||||
import io.provs.test.tags.CONTAINERTEST
|
import io.provs.test.tags.CONTAINERTEST
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
package io.provs
|
package io.provs.test
|
||||||
|
|
||||||
|
import io.provs.Prov
|
||||||
import io.provs.processors.ContainerStartMode
|
import io.provs.processors.ContainerStartMode
|
||||||
import io.provs.processors.ContainerUbuntuHostProcessor
|
import io.provs.processors.ContainerUbuntuHostProcessor
|
||||||
|
|
||||||
val DEFAULT_START_MODE_TEST_CONTAINER = ContainerStartMode.USE_RUNNING_ELSE_CREATE
|
val DEFAULT_START_MODE_TEST_CONTAINER = ContainerStartMode.USE_RUNNING_ELSE_CREATE
|
||||||
|
|
||||||
val testDockerWithSudo = !"true".equals(System.getProperty("testdockerwithoutsudo")?.toLowerCase())
|
val testDockerWithSudo = "true" != System.getProperty("testdockerwithoutsudo")?.toLowerCase()
|
||||||
|
|
||||||
const val defaultTestContainerName = "provs_test"
|
const val defaultTestContainerName = "provs_test"
|
||||||
|
|
||||||
fun defaultTestContainer(): Prov {
|
fun defaultTestContainer(imageName: String = "ubuntu"): Prov {
|
||||||
return Prov.newInstance(
|
return Prov.newInstance(
|
||||||
ContainerUbuntuHostProcessor(
|
ContainerUbuntuHostProcessor(
|
||||||
defaultTestContainerName,
|
defaultTestContainerName,
|
||||||
startMode = DEFAULT_START_MODE_TEST_CONTAINER,
|
startMode = DEFAULT_START_MODE_TEST_CONTAINER,
|
||||||
sudo = testDockerWithSudo
|
sudo = testDockerWithSudo,
|
||||||
|
dockerImage = imageName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue