Skip to content

Commit a1ef04f

Browse files
committed
Add PYTEST_MARKERS env and remove TESTS_REGEX
1 parent 2e66cbb commit a1ef04f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

tests/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ OPENSHIFT_TESTUSER_PASS=
1515
OPENSHIFT_TESTUSER_LOGIN_PROVIDER=
1616
# Setting SKIP_INSTALL will let you run the tests against an ODH instance that is already setup
1717
SKIP_INSTALL=
18-
# Setting TESTS_REGEX will allow you to change which tests are going to be run
19-
TESTS_REGEX=
18+
# Pytest markers to select the tests that will be executed
19+
PYTEST_MARKERS=
2020
# Location inside the container where CI system will retrieve files after a test run
2121
ARTIFACT_DIR=/tmp/artifacts
2222
LOCAL_ARTIFACT_DIR="${PWD}/artifacts"
@@ -37,7 +37,7 @@ run:
3737
# Confirm that we have a directory for storing any screenshots from selenium tests
3838
mkdir -p ${LOCAL_ARTIFACT_DIR}/screenshots
3939
oc config view --flatten --minify > /tmp/tests-kubeconfig
40-
${BUILD_TOOL} run -e SKIP_INSTALL=$(SKIP_INSTALL) -e TESTS_REGEX=$(TESTS_REGEX) -e SKIP_OPERATOR_INSTALL=$(SKIP_OPERATOR_INSTALL) \
40+
${BUILD_TOOL} run -e SKIP_INSTALL=$(SKIP_INSTALL) -e PYTEST_MARKERS=$(PYTEST_MARKERS) -e SKIP_OPERATOR_INSTALL=$(SKIP_OPERATOR_INSTALL) \
4141
-e SKIP_KFDEF_INSTALL=$(SKIP_KFDEF_INSTALL) -e ODHPROJECT=$(ODHPROJECT) \
4242
-e OPENSHIFT_TESTUSER_NAME="$(OPENSHIFT_TESTUSER_NAME)" -e OPENSHIFT_TESTUSER_PASS="$(OPENSHIFT_TESTUSER_PASS)" -e OPENSHIFT_TESTUSER_LOGIN_PROVIDER=$(OPENSHIFT_TESTUSER_LOGIN_PROVIDER) -e ARTIFACT_DIR=$(ARTIFACT_DIR) \
4343
-e LOCAL=$(LOCAL) -e TEARDOWN=$(TEARDOWN)\

tests/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ make clean # remove the artifacts of the test from the cluster (operator, ODH, p
2424
* `BUILD_TOOL=docker/podman`: set the tool used to build and run the testing container
2525
* `SKIP_INSTALL=true/false`: skip the install of the ODH operator, if you've already installed it manually or via a previous test
2626
* `SKIP_KFDEF_INSTALL=true/false`: skip the install of ODH via KFdef, if you've already installed it manually or via a previous test
27-
* `TESTS_REGEX=${REGEX}`: only run tests whose names match the regex
27+
* `PYTEST_MARKERS`: Used to select the tests that will be executed. [Available markers](https://github.com/trustyai-explainability/trustyai-tests/blob/main/pyproject.toml).
2828
* `LOCAL=true/false`: This flag makes the test suite stop and wait for user input between the end of a test script and cluster teardown. This prevents automatic teardown, which is useful for manual inspection of the cluster before teardown when running the tests locally.
2929
* `TEARDOWN=true/false`: This flag will just run the corresponding `teardown` functions within the various tests, useful for cleaning up stranded components from failed tests, without deleting the operator and ODH install. It's recommended to use this with a `make run`, as using `make test` will trigger a `make clean` that fully wipes the cluster.
3030

@@ -47,10 +47,6 @@ If you'd like to run the tests against an instance that already has a KfDef crea
4747
you set `SKIP_KFDEF_INSTALL=true` and that will cause the test run
4848
to skip the step of creating the default KfDef. example: `make run SKIP_KFDEF_INSTALL=true`
4949

50-
If you'd like to run a single test instead of all tests, you can
51-
set the TESTS_REGEX variable `TESTS_REGEX=<name of the test to run>`. That will
52-
only run the test that you specify instead of all of the tests. example: `make run TESTS_REGEX=grafana`
53-
5450
If you have a local instance already running the operator and you'd like to skip that part
5551
of the install process, you can set `SKIP_OPERATOR_INSTALL=true` and that will bypass installation
5652
of the operator, but will still install the authentication for any user tests.

0 commit comments

Comments
 (0)