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

Factor out the need for docker compose from docker tasks, to apply only to the ones that really need it. #1882

Merged
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
25 changes: 15 additions & 10 deletions Integrations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ idea {
JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention
SourceSet test = java.sourceSets.maybeCreate('test')

def runInDocker = { String name, String sourcePath, List<String> command ->
def runInDocker = { String name, String sourcePath, List<String> command, Closure addConfig = {} ->
Docker.registerDockerTask(project, name) {
copyIn {
from(sourcePath) {
Expand All @@ -89,9 +89,7 @@ def runInDocker = { String name, String sourcePath, List<String> command ->

imageName = 'deephaven/py-integrations:local-build'

network = dockerCompose.projectName.toLowerCase() + '_default'
containerDependencies.dependsOn = dockerCompose.upTask
containerDependencies.finalizedBy = dockerCompose.downTask
addConfig(it)

dockerfile {
// set up the container, env vars - things that aren't likely to change
Expand Down Expand Up @@ -121,7 +119,19 @@ def runInDocker = { String name, String sourcePath, List<String> command ->
}
}
}
def pyTest = runInDocker("test-py-37", 'python', ['python3', '-m', 'xmlrunner', 'discover', '-v', '-o', '/out/report'])

// Using Integrations/docker-compose.yml, this will start redpanda and wait until it is running before letting tests proceed.
dockerCompose {
waitForTcpPortsTimeout = Duration.ofMinutes(2)
}

Closure composeConfig = { task ->
task.network = dockerCompose.projectName.toLowerCase() + '_default'
task.containerDependencies.dependsOn = dockerCompose.upTask
task.containerDependencies.finalizedBy = dockerCompose.downTask
}

def pyTest = runInDocker("test-py-37", 'python', ['python3', '-m', 'xmlrunner', 'discover', '-v', '-o', '/out/report'], composeConfig)
def pyFunctionalTest = runInDocker('py-functional-test', 'python', ['/bin/bash', 'run-functional-tests.sh'])
def pyTest2 = runInDocker('test-py-deephaven2', '../pyintegration', ['python3', '-m', 'xmlrunner', 'discover', 'tests', '-v', '-o', '/out/report'])
pyTest.configure({
Expand All @@ -138,8 +148,3 @@ pyTest2.configure({
onlyIf { TestTools.shouldRunTests(project) }
})
tasks.getByName('check').dependsOn(pyTest2)

// Using Integrations/docker-compose.yml, this will start redpanda and wait until it is running before letting tests proceed.
dockerCompose {
waitForTcpPortsTimeout = Duration.ofMinutes(2)
}