Skip to content

Commit 57c644a

Browse files
claudevdmClaude
andauthored
Fix test (#34162)
* Fix test. * Trigger post commit. * Use highmem22 for postcommit python. * Run postcommit 311. * Revert "Run postcommit 311." This reverts commit a3de98f. * Use flink config in portable tests. * Temporarily disable some tests. * Revert "Temporarily disable some tests." This reverts commit e3ae832. * Move xlang_jdbc to xlang direct. * Trigger affected workflows. --------- Co-authored-by: Claude <cvandermerwe@google.com>
1 parent 9303e3e commit 57c644a

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run.",
33
"https://github.com/apache/beam/pull/32440": "test new datastream runner for batch"
4-
"modification": 8
4+
"modification": 9
55
}
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 11
3+
"modification": 10
44
}

sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919

2020
import datetime
2121
import logging
22+
import os
2223
import time
2324
import typing
2425
import unittest
2526
from decimal import Decimal
2627

28+
import pytest
2729
from parameterized import parameterized
2830

2931
import apache_beam as beam
@@ -88,13 +90,24 @@
8890
coders.registry.register_coder(SimpleRow, coders.RowCoder)
8991

9092

93+
@pytest.mark.uses_gcp_java_expansion_service
94+
@unittest.skipUnless(
95+
os.environ.get('EXPANSION_JARS'),
96+
"EXPANSION_JARS environment var is not provided, "
97+
"indicating that jars have not been built")
9198
@unittest.skipIf(sqlalchemy is None, 'sql alchemy package is not installed.')
9299
@unittest.skipIf(
93100
PostgresContainer is None, 'testcontainers package is not installed')
94101
@unittest.skipIf(
95102
TestPipeline().get_pipeline_options().view_as(StandardOptions).runner is
96103
None,
97104
'Do not run this test on precommit suites.')
105+
@unittest.skipIf(
106+
TestPipeline().get_pipeline_options().view_as(StandardOptions).runner is
107+
not None and
108+
"dataflowrunner" in TestPipeline().get_pipeline_options().view_as(
109+
StandardOptions).runner.lower(),
110+
'Do not run this test on dataflow runner.')
98111
class CrossLanguageJdbcIOTest(unittest.TestCase):
99112
DbData = typing.NamedTuple(
100113
'DbData',
@@ -436,8 +449,7 @@ def test_xlang_jdbc_custom_statements(self, database):
436449
partition_column="id",
437450
schema=SimpleRow))
438451

439-
# revert
440-
assert_that(result, equal_to(test_rows))
452+
assert_that(result, equal_to(expected_filtered_rows))
441453

442454

443455
if __name__ == '__main__':

sdks/python/test-suites/portable/common.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,19 @@ project.tasks.register("postCommitPy${pythonVersionSuffix}IT") {
385385
doLast {
386386
def tests = [
387387
"apache_beam/io/gcp/bigquery_read_it_test.py",
388-
"apache_beam/io/external/xlang_jdbcio_it_test.py",
389388
"apache_beam/io/external/xlang_kafkaio_it_test.py",
390389
"apache_beam/io/external/xlang_kinesisio_it_test.py",
391390
"apache_beam/io/external/xlang_debeziumio_it_test.py",
392391
]
393392
def testOpts = ["${tests.join(' ')}"] + ["--log-cli-level=INFO"]
393+
def flink_conf_dir = "${rootDir}/runners/flink/src/test/resources/"
394394
def pipelineOpts = [
395395
"--runner=FlinkRunner",
396396
"--project=apache-beam-testing",
397397
"--environment_type=LOOPBACK",
398398
"--temp_location=gs://temp-storage-for-end-to-end-tests/temp-it",
399399
"--flink_job_server_jar=${project(":runners:flink:${latestFlinkVersion}:job-server").shadowJar.archivePath}",
400+
"--flink_conf_dir=${flink_conf_dir}",
400401
'--sdk_harness_log_level_overrides=' +
401402
// suppress info level flink.runtime log flood
402403
'{\\"org.apache.flink.runtime\\":\\"WARN\\",' +

0 commit comments

Comments
 (0)