Skip to content

Commit

Permalink
Make the TransformService test suite not pass trivially.
Browse files Browse the repository at this point in the history
  • Loading branch information
chamikaramj committed Mar 4, 2024
1 parent 6a03f9b commit 94a5161
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2890,7 +2890,8 @@ class BeamModulePlugin implements Plugin<Project> {
def cmdArgs = project.project(':sdks:python').mapToArgString(beamPythonTestPipelineOptions)

project.exec {
environment "EXPANSION_PORT", externalPort
// Following env variable has to be set to make sure that the tests do not pass trivially.
environment "TRANSFORM_SERVICE_PORT", externalPort
executable 'sh'
args '-c', ". $envDir/bin/activate && cd $pythonDir && ./scripts/run_integration_test.sh $cmdArgs"
}
Expand Down
14 changes: 8 additions & 6 deletions sdks/python/apache_beam/io/gcp/bigtableio_it_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ def instance_prefix(instance):
@pytest.mark.uses_transform_service
@unittest.skipIf(client is None, 'Bigtable dependencies are not installed')
@unittest.skipUnless(
os.environ.get('EXPANSION_JARS'),
"EXPANSION_JARS environment var is not provided, "
"indicating that jars have not been built")
os.environ.get('EXPANSION_JARS') or
os.environ.get('TRANSFORM_SERVICE_PORT'),
"A valid expansion service is not available for executing the "
"cross-language test.")
class TestReadFromBigTableIT(unittest.TestCase):
INSTANCE = "bt-read-tests"
TABLE_ID = "test-table"
Expand Down Expand Up @@ -151,9 +152,10 @@ def test_read_xlang(self):
@pytest.mark.uses_transform_service
@unittest.skipIf(client is None, 'Bigtable dependencies are not installed')
@unittest.skipUnless(
os.environ.get('EXPANSION_JARS'),
"EXPANSION_JARS environment var is not provided, "
"indicating that jars have not been built")
os.environ.get('EXPANSION_JARS') or
os.environ.get('TRANSFORM_SERVICE_PORT'),
"A valid expansion service is not available for executing the "
"cross-language test.")
class TestWriteToBigtableXlangIT(unittest.TestCase):
# These are integration tests for the cross-language write transform.
INSTANCE = "bt-write-xlang"
Expand Down

0 comments on commit 94a5161

Please sign in to comment.