Skip to content

Commit f994db1

Browse files
authored
Add support PyTest test suite (#373)
* Add support PyTest test suite * Use script for testing containers by `run-openshift-pytest` * Remove double brackets with single brackets. Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 26d4aa7 commit f994db1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

common.mk

+6
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ test-openshift: script_env += TEST_OPENSHIFT_MODE=true
110110
test-openshift: tag
111111
VERSIONS="$(VERSIONS)" BASE_IMAGE_NAME="$(BASE_IMAGE_NAME)" $(script_env) $(test)
112112

113+
.PHONY: test-openshift-pytest
114+
test-openshift-pytest: script_env += TEST_OPENSHIFT_PYTEST=true
115+
test-openshift-pytest: tag
116+
VERSIONS="$(VERSIONS)" BASE_IMAGE_NAME="$(BASE_IMAGE_NAME)" $(script_env) $(test)
117+
118+
113119
.PHONY: shellcheck
114120
shellcheck:
115121
$(shellcheck) $(SHELLCHECK_FILES)

test.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ for dir in ${VERSIONS}; do
5757
if [ -e ".exclude-openshift" ]; then
5858
echo "-> .exclude-openshift file exists for version $dir, skipping OpenShift-4 tests."
5959
else
60-
if [[ -x test/run-openshift-remote-cluster ]]; then
60+
if [ -x test/run-openshift-remote-cluster ]; then
6161
VERSION=$dir test/run-openshift-remote-cluster
6262
failed_version "$?" "$dir"
6363
else
@@ -68,13 +68,23 @@ for dir in ${VERSIONS}; do
6868
fi
6969

7070
if [ -n "${TEST_UPSTREAM}" ]; then
71-
if [[ -x test/run-upstream ]]; then
71+
if [ -x test/run-upstream ]; then
7272
VERSION=$dir test/run-upstream
7373
failed_version "$?" "$dir"
7474
else
7575
echo "-> Upstream tests are not present, skipping"
7676
fi
7777
fi
78+
79+
if [ -n "${TEST_OPENSHIFT_PYTEST}" ]; then
80+
if [ -x test/run-openshift-pytest ]; then
81+
VERSION=$dir test/run-openshift-pytest
82+
failed_version "$?" "$dir"
83+
else
84+
echo "-> PyTest tests are not present, skipping"
85+
fi
86+
fi
87+
7888
popd > /dev/null || exit 1
7989
done
8090

0 commit comments

Comments
 (0)