Skip to content

Commit

Permalink
Run arm suite against all validates_container tests (apache#28627)
Browse files Browse the repository at this point in the history
* Run arm suite against all validates_container tests

* Exclude prebuildd container tests

* Format

* Add comment pointing to issue
  • Loading branch information
damccorm authored Sep 26, 2023
1 parent 70979bf commit 57954bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 5 additions & 4 deletions sdks/python/apache_beam/examples/wordcount_it_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ def test_wordcount_it_with_prebuilt_sdk_container_cloud_build(self):
def test_wordcount_it_with_use_sibling_sdk_workers(self):
self._run_wordcount_it(wordcount.run, experiment='use_sibling_sdk_workers')

@pytest.mark.it_dataflow_arm
def test_wordcount_fnapi_it_arm(self):
self._run_wordcount_it(wordcount.run, machine_type='t2a-standard-1')

def _run_wordcount_it(self, run_wordcount, **opts):
test_pipeline = TestPipeline(is_integration_test=True)
extra_opts = {}

if (test_pipeline.get_option('machine_type') == 't2a-standard-1' and
'prebuild_sdk_container_engine' in opts):
# TODO(https://github.com/apache/beam/issues/28340)
pytest.skip('prebuild_sdk_container_engine not supported on ARM')

# Set extra options to the pipeline for test purpose
test_output = '/'.join([
test_pipeline.get_option('output'),
Expand Down
10 changes: 4 additions & 6 deletions sdks/python/container/run_validatescontainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ARCH=${3:-"x86"}
IMAGE_NAME="${IMAGE_PREFIX}python${PY_VERSION}_sdk"
CONTAINER_PROJECT="sdks:python:container:py${PY_VERSION//.}" # Note: we substitute away the dot in the version.
PY_INTERPRETER="python${PY_VERSION}"
TEST_SUITE_TAG="it_validatescontainer"
MACHINE_TYPE_ARGS=""

XUNIT_FILE="pytest-$IMAGE_NAME.xml"

Expand Down Expand Up @@ -88,12 +88,9 @@ if [[ "$ARCH" == "x86" ]]; then
# Push the container
gcloud docker -- push $CONTAINER:$TAG
elif [[ "$ARCH" == "ARM" ]]; then
# Note: ARM test suites only run on github actions, where multi-arch Python SDK containers are already pushed during build.
# Reset the test suite tag to run ARM pipelines.
TEST_SUITE_TAG="it_dataflow_arm"

# Reset the multi-arch Python SDK container image tag.
TAG=$MULTIARCH_TAG
MACHINE_TYPE_ARGS="--machine_type=t2a-standard-1"
else
printf "Please give a valid CPU architecture, either x86 or ARM."
exit 1
Expand Down Expand Up @@ -126,7 +123,7 @@ SDK_LOCATION=$2

echo ">>> RUNNING DATAFLOW RUNNER VALIDATESCONTAINER TEST"
pytest -o log_cli=True -o log_level=Info -o junit_suite_name=$IMAGE_NAME \
-m=$TEST_SUITE_TAG \
-m=it_validatescontainer \
--numprocesses=1 \
--timeout=1800 \
--junitxml=$XUNIT_FILE \
Expand All @@ -142,6 +139,7 @@ pytest -o log_cli=True -o log_level=Info -o junit_suite_name=$IMAGE_NAME \
--output=$GCS_LOCATION/output \
--sdk_location=$SDK_LOCATION \
--num_workers=1 \
$MACHINE_TYPE_ARGS \
--docker_registry_push_url=$PREBUILD_SDK_CONTAINER_REGISTRY_PATH"

echo ">>> SUCCESS DATAFLOW RUNNER VALIDATESCONTAINER TEST"

0 comments on commit 57954bd

Please sign in to comment.