Skip to content
/ beam Public
forked from apache/beam

Commit

Permalink
[BEAM-6619] Add PostCommit sutie for Py3 ITs on DataflowRunner (apach…
Browse files Browse the repository at this point in the history
…e#7756)

* [BEAM-6619] Add PostCommit sutie for Py3 ITs on DataflowRunner
  • Loading branch information
markflyhigh authored and aaltay committed Feb 7, 2019
1 parent 9799b7d commit 4d729e6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ task goIntegrationTests() {

task pythonPreCommit() {
dependsOn ":beam-sdks-python:preCommit"
dependsOn ":beam-sdks-python-precommit-dataflow:precommitIT"
dependsOn ":beam-sdks-python-precommit-direct-py3:precommitIT"
}

task pythonPostCommit() {
Expand Down
3 changes: 3 additions & 0 deletions sdks/python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ task preCommit() {
dependsOn "testPy2Gcp"
dependsOn "testPy3Gcp"
dependsOn "lint"
dependsOn ":beam-sdks-python-precommit-dataflow:preCommitIT"
dependsOn ":beam-sdks-python-precommit-direct-py3:preCommitIT"
}

task portablePreCommit() {
Expand Down Expand Up @@ -386,6 +388,7 @@ task postCommit() {
dependsOn "directRunnerIT"
dependsOn "hdfsIntegrationTest"
dependsOn "postCommitIT"
dependsOn ":beam-sdks-python-precommit-dataflow-py3:preCommitIT"
}


Expand Down
2 changes: 1 addition & 1 deletion sdks/python/precommit/dataflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ applyPythonNature()

def runScriptsDir = "${project.rootDir}/sdks/python/scripts"

task precommitIT(dependsOn: ['sdist', 'installGcpTest']) {
task preCommitIT(dependsOn: ['sdist', 'installGcpTest']) {
doLast {
// Basic integration tests to run in PreCommit
def precommitTests = [
Expand Down
39 changes: 39 additions & 0 deletions sdks/python/precommit/dataflow/py3/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyPythonNature()

// Required to setup a Python 3 virtualenv.
project.ext.python3 = true

def runScriptsDir = "${project.rootDir}/sdks/python/scripts"

task preCommitIT(dependsOn: ['sdist', 'installGcpTest']) {
doLast {
def testOpts = [
"--tests=apache_beam.examples.wordcount_it_test:WordCountIT.test_wordcount_it",
"--nocapture", // Print stdout instantly
]
def cmdArgs = project.mapToArgString(["test_opts": testOpts])
exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && ${runScriptsDir}/run_integration_test.sh $cmdArgs"
}
}
}
2 changes: 1 addition & 1 deletion sdks/python/precommit/direct/py3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ project.ext.python3 = true

def runScriptsDir = "${project.rootDir}/sdks/python/scripts"

task precommitIT(dependsOn: ['sdist', 'installGcpTest']) {
task preCommitIT(dependsOn: ['sdist', 'installGcpTest']) {
// Run IT tests with TestDirectRunner in batch in Python 3.
doLast {
def testOpts = [
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ include "beam-sdks-python-container-py3"
project(":beam-sdks-python-container-py3").dir = file("sdks/python/container/py3")
include "beam-sdks-python-precommit-dataflow"
project(":beam-sdks-python-precommit-dataflow").dir = file("sdks/python/precommit/dataflow")
include "beam-sdks-python-precommit-dataflow-py3"
project(":beam-sdks-python-precommit-dataflow-py3").dir = file("sdks/python/precommit/dataflow/py3")
include "beam-sdks-python-precommit-direct-py3"
project(":beam-sdks-python-precommit-direct-py3").dir = file("sdks/python/precommit/direct/py3")
include "beam-vendor-grpc-1_13_1"
Expand Down

0 comments on commit 4d729e6

Please sign in to comment.