Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
771bfe5
fix postcommit oracle test
derrickaw Jun 6, 2025
91abfe5
add revision
derrickaw Jun 6, 2025
f22539b
switch to hosted runner to try with kafka test
derrickaw Jun 6, 2025
53fabed
add extended timeout
derrickaw Jun 9, 2025
01865d5
upgrade to 4.10 testcontainers
derrickaw Jun 9, 2025
9c969d9
switch out to redpanda for kafka
derrickaw Jun 9, 2025
2c9c3fb
remove redpandacontainer
derrickaw Jun 9, 2025
9e2033d
tmp comment
derrickaw Jun 10, 2025
f69cc52
add postgres comment
derrickaw Jun 10, 2025
1273a7b
revert to old kafkaContainer
derrickaw Jun 10, 2025
e0cffaf
revert commented out code and revert testcontainer version change
derrickaw Jun 10, 2025
88aedfd
change mysql image version
derrickaw Jun 10, 2025
f30553e
revert image change
derrickaw Jun 10, 2025
c2593d3
revert image change again :)
derrickaw Jun 10, 2025
ceeee21
add comments to mysql again
derrickaw Jun 10, 2025
f6138ec
shift post commit files to different folders
derrickaw Jun 10, 2025
bbf5b62
rename to Data version
derrickaw Jun 10, 2025
364bd00
add databases version
derrickaw Jun 10, 2025
d525d7a
add messaging version
derrickaw Jun 10, 2025
3cd913d
update readme for three post commits
derrickaw Jun 10, 2025
d105717
update gradle with new post commits
derrickaw Jun 10, 2025
dae1836
fix job names
derrickaw Jun 10, 2025
2b6c2b6
uncomment fixture on mysql
derrickaw Jun 10, 2025
0912a36
switch back to one workflow and update readme as such
derrickaw Jun 11, 2025
ba4eb6f
remove old workflow files
derrickaw Jun 11, 2025
c193e67
update order and remove comment
derrickaw Jun 11, 2025
bc7d86e
update gradle with parameterized options
derrickaw Jun 11, 2025
027dee2
update gradle command calls to correct location
derrickaw Jun 11, 2025
19de3bc
update workflow to three jobs explicit
derrickaw Jun 11, 2025
28d35c1
add back Bigquery deselect
derrickaw Jun 11, 2025
72ab27b
fix mysql teardown error
derrickaw Jun 11, 2025
7d732c9
Simplify down to one from three explicit jobs
derrickaw Jun 11, 2025
4783bda
remove tab
derrickaw Jun 11, 2025
6bdf8b4
remove Data
derrickaw Jun 11, 2025
f5c5ca9
fix parsing parameters
derrickaw Jun 11, 2025
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"revision": 1
"revision": 2
}
12 changes: 7 additions & 5 deletions .github/workflows/beam_PostCommit_Yaml_Xlang_Direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,22 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request_target' ||
(github.event_name == 'schedule' && github.repository == 'apache/beam')
runs-on: [self-hosted, ubuntu-20.04, main]
runs-on: ubuntu-latest
timeout-minutes: 100
name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
strategy:
matrix:
job_name: ["beam_PostCommit_Yaml_Xlang_Direct"]
job_phrase: ["Run Yaml_Xlang_Direct PostCommit"]
test_set: ["data", "databases", "messaging"]
steps:
- uses: actions/checkout@v4
- name: Setup repository
uses: ./.github/actions/setup-action
with:
comment_phrase: ${{ matrix.job_phrase }}
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.test_set }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
github_job: ${{ matrix.job_name }} ${{ matrix.test_set }} (${{ matrix.job_phrase }} ${{ matrix.test_set }})
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
Expand All @@ -79,7 +80,7 @@ jobs:
- name: run PostCommit Yaml Xlang Direct script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :sdks:python:postCommitYamlIntegrationTests -PbeamPythonExtra=ml_test
gradle-command: :sdks:python:postCommitYamlIntegrationTests -PyamlTestSet=${{ matrix.test_set }} -PbeamPythonExtra=ml_test
- name: Archive Python Test Results
uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -93,4 +94,5 @@ jobs:
commit: '${{ env.prsha || env.GITHUB_SHA }}'
comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }}
files: '**/pytest*.xml'
large_files: true
large_files: true

12 changes: 6 additions & 6 deletions sdks/python/apache_beam/yaml/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def temp_mysql_database():
with the MySQL database during setup.
Exception: Any other exception encountered during the setup process.
"""
with MySqlContainer() as mysql_container:
with MySqlContainer(init=True) as mysql_container:
try:
# Make connection to temp database and create tmp table
engine = sqlalchemy.create_engine(mysql_container.get_connection_url())
Expand Down Expand Up @@ -440,12 +440,12 @@ def temp_kafka_server():
Exception: If there's an error starting the Kafka container or
interacting with the temporary Kafka server.
"""
try:
with KafkaContainer() as kafka_container:
with KafkaContainer() as kafka_container:
try:
yield kafka_container.get_bootstrap_server()
except Exception as err:
logging.error("Error interacting with temporary Kakfa Server: %s", err)
raise err
except Exception as err:
logging.error("Error interacting with temporary Kakfa Server: %s", err)
raise err


@contextlib.contextmanager
Expand Down
29 changes: 24 additions & 5 deletions sdks/python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ tasks.register("yamlIntegrationTests") {
doLast {
exec {
executable 'sh'
args '-c', "${envdir}/bin/pytest -v apache_beam/yaml/integration_tests.py --deselect apache_beam/yaml/integration_tests.py::BigqueryTest::test_ReadFromBigQuery_ExternalJavaProvider_0"
args '-c', "${envdir}/bin/pytest -v apache_beam/yaml/integration_tests.py"
}
}
}

tasks.register("postCommitYamlIntegrationTests") {
description "Runs postcommit integration tests for yaml pipelines."
description "Runs postcommit integration tests for yaml pipelines - parameterized by yamlTestSet."

dependsOn installGcpTest
// Need to build all expansion services referenced in apache_beam/yaml/*.*
Expand All @@ -155,9 +155,28 @@ tasks.register("postCommitYamlIntegrationTests") {
dependsOn ":sdks:java:io:google-cloud-platform:expansion-service:build"

doLast {
exec {
executable 'sh'
args '-c', "${envdir}/bin/pytest -v apache_beam/yaml/integration_tests.py --deselect apache_beam/yaml/integration_tests.py::BigqueryTest::test_ReadFromBigQuery_ExternalJavaProvider_0 --test_files_dir='extended_tests'"
def testSetInput = project.findProperty('yamlTestSet') ?: 'data,databases,messaging'
def testSetsToRun = testSetInput.tokenize(',').collect { it.trim() }.findAll { !it.isEmpty() }
testSetsToRun.each { currentTestSet ->
def test_files_dir

switch (currentTestSet) {
case 'data':
test_files_dir = 'extended_tests/data'
break
case 'databases':
test_files_dir = 'extended_tests/databases'
break
case 'messaging':
test_files_dir = 'extended_tests/messaging'
break
default:
throw StopExecutionException("Unknown yamlTestSet: ${testSet}. Must be one of 'data', 'databases', or 'messaging'.")
}
exec {
executable 'sh'
args '-c', "${envdir}/bin/pytest -v apache_beam/yaml/integration_tests.py --deselect apache_beam/yaml/integration_tests.py::BigqueryTest::test_ReadFromBigQuery_ExternalJavaProvider_0 --test_files_dir='${test_files_dir}'"
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ def get_portability_package_data():
'virtualenv-clone>=0.5,<1.0',
'mysql-connector-python>=9.3.0',
'python-tds>=1.16.1',
'sqlalchemy-pytds>=1.0.2'
'sqlalchemy-pytds>=1.0.2',
'oracledb>=3.1.1'
],
'gcp': [
'cachetools>=3.1.0,<6',
Expand Down
Loading