diff --git a/test/canary/scripts/run_test.sh b/test/canary/scripts/run_test.sh index 4a93985b..094e7424 100755 --- a/test/canary/scripts/run_test.sh +++ b/test/canary/scripts/run_test.sh @@ -94,13 +94,20 @@ pushd $E2E_DIR # run tests echo "Run Tests" pytest_args=( -n 15 --dist loadfile --log-cli-level INFO --junitxml ../canary/integration_tests.xml) + declare pytest_marks if [[ $SERVICE_REGION =~ ^(eu-north-1|eu-west-3)$ ]]; then # If select_regions_1 true we run the notebook_instance test - pytest_args+=(-m "canary or select_regions_1") + pytest_marks="canary or select_regions_1" elif [[ $SHALLOW_REGION = "shallow" ]]; then - pytest_args+=(-m "shallow_canary") + pytest_marks="shallow_canary" else - pytest_args+=(-m "canary") + pytest_marks="canary" fi + 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 + # Above is the list of supported regions for Inference Component and if the current region is + # included in this we will add the inference_component mark. + pytest_marks+=" or inference_component" + fi + pytest_args+=(-m "$pytest_marks") pytest "${pytest_args[@]}" popd diff --git a/test/e2e/conftest.py b/test/e2e/conftest.py index 9ec910a2..111035bf 100644 --- a/test/e2e/conftest.py +++ b/test/e2e/conftest.py @@ -31,6 +31,7 @@ def pytest_configure(config): config.addinivalue_line("markers", "slow: mark test as slow to run") config.addinivalue_line("markers", "select_regions_1: mark test to only run if in select region") config.addinivalue_line("markers", "shallow_canary: mark test to run in shallow canary tests") + config.addinivalue_line("markers", "inference_component: mark test to run inference component tests in select regions") def pytest_collection_modifyitems(config, items): diff --git a/test/e2e/tests/test_inference_component.py b/test/e2e/tests/test_inference_component.py index c051a248..b0db9d33 100644 --- a/test/e2e/tests/test_inference_component.py +++ b/test/e2e/tests/test_inference_component.py @@ -206,8 +206,7 @@ def faulty_model(name_suffix, xgboost_model): @service_marker -@pytest.mark.shallow_canary -@pytest.mark.canary +@pytest.mark.inference_component class TestInferenceComponent: def create_inference_component_test(self, inference_component): (reference, resource, _) = inference_component