Skip to content

Commit 5911a6d

Browse files
Add inference_component marker to exclude non supported regions. (#267)
Issue #, if available: Description of changes: By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d319a57 commit 5911a6d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

test/canary/scripts/run_test.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,20 @@ pushd $E2E_DIR
9494
# run tests
9595
echo "Run Tests"
9696
pytest_args=( -n 15 --dist loadfile --log-cli-level INFO --junitxml ../canary/integration_tests.xml)
97+
declare pytest_marks
9798
if [[ $SERVICE_REGION =~ ^(eu-north-1|eu-west-3)$ ]]; then
9899
# If select_regions_1 true we run the notebook_instance test
99-
pytest_args+=(-m "canary or select_regions_1")
100+
pytest_marks="canary or select_regions_1"
100101
elif [[ $SHALLOW_REGION = "shallow" ]]; then
101-
pytest_args+=(-m "shallow_canary")
102+
pytest_marks="shallow_canary"
102103
else
103-
pytest_args+=(-m "canary")
104+
pytest_marks="canary"
104105
fi
106+
if [[ $SERVICE_REGION =~ ^(eu-north-1|ap-south-1|ap-southeast-3|us-east-2|me-central-1|eu-west-1|eu-central-1|sa-east-1|us-east-1|ap-northeast-2|eu-west-2|ap-northeast-1|us-west-2|ap-southeast-1|ap-southeast-2|ca-central-1)$ ]]; then
107+
# Above is the list of supported regions for Inference Component and if the current region is
108+
# included in this we will add the inference_component mark.
109+
pytest_marks+=" or inference_component"
110+
fi
111+
pytest_args+=(-m "$pytest_marks")
105112
pytest "${pytest_args[@]}"
106113
popd

test/e2e/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def pytest_configure(config):
3131
config.addinivalue_line("markers", "slow: mark test as slow to run")
3232
config.addinivalue_line("markers", "select_regions_1: mark test to only run if in select region")
3333
config.addinivalue_line("markers", "shallow_canary: mark test to run in shallow canary tests")
34+
config.addinivalue_line("markers", "inference_component: mark test to run inference component tests in select regions")
3435

3536

3637
def pytest_collection_modifyitems(config, items):

test/e2e/tests/test_inference_component.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ def faulty_model(name_suffix, xgboost_model):
206206

207207

208208
@service_marker
209-
@pytest.mark.shallow_canary
210-
@pytest.mark.canary
209+
@pytest.mark.inference_component
211210
class TestInferenceComponent:
212211
def create_inference_component_test(self, inference_component):
213212
(reference, resource, _) = inference_component

0 commit comments

Comments
 (0)