Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .test-infra/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Beam Jenkins overview page: [link](https://ci-beam.apache.org/)
| beam_PreCommit_Portable_Python | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Phrase/) | `Run Portable_Python PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron) |
| beam_PreCommit_PythonLint | [commit](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Phrase/) | `Run PythonLint PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron) |
| beam_PreCommit_Python | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Phrase/) | `Run Python PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron) |
| beam_PreCommit_Python_Integration | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Integration_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Integration_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Integration_Phrase/) | `Run Python_Integration PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Integration_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Integration_Cron) |
| beam_PreCommit_Python_Dataframes | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Dataframes_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Dataframes_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Dataframes_Phrase/) | `Run Python_Dataframes PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Dataframes_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Dataframes_Cron) |
| beam_PreCommit_Python_Examples | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Examples_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Examples_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Examples_Phrase/) | `Run Python_Examples PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Examples_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Examples_Cron) |
| beam_PreCommit_Python_Runners | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Runners_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Runners_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Runners_Phrase/) | `Run Python_Runners PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Runners_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Runners_Cron) |
| beam_PreCommit_Python_Transforms | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_Transforms_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_Transforms_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_Transforms_Phrase/) | `Run Python_Transforms PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Transforms_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Transforms_Cron) |
| beam_PreCommit_PythonDocker | [commit](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Phrase/) | `Run PythonDocker PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/) |
| beam_PreCommit_PythonDocs| [commit](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Phrase/) | `Run PythonDocs PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/) |
| beam_PreCommit_Python_PVR_Flink | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Phrase/) | `Run Python_PVR_Flink PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron) |
Expand Down
3 changes: 3 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
],
gradleSwitches: [
'-Pposargs=\"--ignore=apache_beam/dataframe/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/\"' // All these tests are covered by different jobs.
]
)
builder.build {
Expand Down
37 changes: 37 additions & 0 deletions .test-infra/jenkins/job_PreCommit_PythonIT.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.
*/

import PrecommitJobBuilder

PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Integration',
gradleTask: ':pythonPreCommitIT',
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build {
// Publish all test results to Jenkins.
publishers {
archiveJunit('**/pytest*.xml')
}
}
40 changes: 40 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python_Dataframes.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

import PrecommitJobBuilder

PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Dataframes',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/dataframe/'
],
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build {
// Publish all test results to Jenkins.
publishers {
archiveJunit('**/pytest*.xml')
}
}
40 changes: 40 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python_Examples.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

import PrecommitJobBuilder

PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Examples',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/examples/'
],
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build {
// Publish all test results to Jenkins.
publishers {
archiveJunit('**/pytest*.xml')
}
}
40 changes: 40 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python_Runners.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

import PrecommitJobBuilder

PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Runners',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/runners/'
],
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build {
// Publish all test results to Jenkins.
publishers {
archiveJunit('**/pytest*.xml')
}
}
40 changes: 40 additions & 0 deletions .test-infra/jenkins/job_PreCommit_Python_Transforms.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

import PrecommitJobBuilder

PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'Python_Transforms',
gradleTask: ':pythonPreCommit',
gradleSwitches: [
'-Pposargs=apache_beam/transforms/'
],
timeoutMins: 180,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build {
// Publish all test results to Jenkins.
publishers {
archiveJunit('**/pytest*.xml')
}
}
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ tasks.register("pythonPreCommit") {
dependsOn(":sdks:python:test-suites:tox:py38:preCommitPy38")
dependsOn(":sdks:python:test-suites:tox:py39:preCommitPy39")
dependsOn(":sdks:python:test-suites:tox:py310:preCommitPy310")
}

tasks.register("pythonPreCommitIT") {
dependsOn(":sdks:python:test-suites:tox:pycommon:preCommitPyCommon")
dependsOn(":sdks:python:test-suites:dataflow:preCommitIT")
dependsOn(":sdks:python:test-suites:dataflow:preCommitIT_V2")
}
Expand Down
5 changes: 5 additions & 0 deletions sdks/python/scripts/run_pytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ if [[ $pytest_args =~ "-m" ]] || [[ $posargs =~ "-m" ]]; then
exit 1
fi

# strip leading/trailing quotes from posargs because it can get double quoted as its passed through.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is the quotes the actual cause prevented --ignore to work #24204 (comment) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - it tried to parse '--ignore=apache_beam/coders as an argument instead of the ignore flag.

posargs=$(sed -e 's/^"//' -e 's/"$//' -e "s/'$//" -e "s/^'//" <<<$posargs)
echo "pytest_args: $pytest_args"
echo "posargs: $posargs"

# Run with pytest-xdist and without.
pytest -o junit_suite_name=${envname} \
--junitxml=pytest_${envname}.xml -m 'not no_xdist' -n 6 ${pytest_args} --pyargs ${posargs}
Expand Down
12 changes: 7 additions & 5 deletions sdks/python/test-suites/tox/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@

def pythonVersionSuffix = project.ext.pythonVersion.replace('.', '')

toxTask "testPython${pythonVersionSuffix}", "py${pythonVersionSuffix}"
def posargs = project.findProperty("posargs") ?: ""

toxTask "testPython${pythonVersionSuffix}", "py${pythonVersionSuffix}", "${posargs}"
test.dependsOn "testPython${pythonVersionSuffix}"

toxTask "testPy${pythonVersionSuffix}Cloud", "py${pythonVersionSuffix}-cloud"
toxTask "testPy${pythonVersionSuffix}Cloud", "py${pythonVersionSuffix}-cloud", "${posargs}"
test.dependsOn "testPy${pythonVersionSuffix}Cloud"

toxTask "testPy${pythonVersionSuffix}Dask", "py${pythonVersionSuffix}-dask"
toxTask "testPy${pythonVersionSuffix}Dask", "py${pythonVersionSuffix}-dask", "${posargs}"
test.dependsOn "testPy${pythonVersionSuffix}Dask"

toxTask "testPy${pythonVersionSuffix}Cython", "py${pythonVersionSuffix}-cython"
toxTask "testPy${pythonVersionSuffix}Cython", "py${pythonVersionSuffix}-cython", "${posargs}"
test.dependsOn "testPy${pythonVersionSuffix}Cython"

toxTask "testPy38CloudCoverage", "py38-cloudcoverage"
toxTask "testPy38CloudCoverage", "py38-cloudcoverage", "${posargs}"
test.dependsOn "testPy38CloudCoverage"

project.tasks.register("preCommitPy${pythonVersionSuffix}") {
Expand Down
6 changes: 4 additions & 2 deletions sdks/python/test-suites/tox/py37/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ applyPythonNature()
// Required to setup a Python 3 virtualenv and task names.
pythonVersion = '3.7'

def posargs = project.findProperty("posargs") ?: ""

task lint {}
check.dependsOn lint

toxTask "lintPy37", "py37-lint"
toxTask "lintPy37", "py37-lint", "${posargs}"
lint.dependsOn lintPy37

toxTask "mypyPy37", "py37-mypy"
toxTask "mypyPy37", "py37-mypy", "${posargs}"
lint.dependsOn mypyPy37

apply from: "../common.gradle"
Expand Down
Loading