Skip to content

Commit

Permalink
Add support PyTest test suite (#373)
Browse files Browse the repository at this point in the history
* 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 <phracek@redhat.com>
  • Loading branch information
phracek authored Jun 7, 2024
1 parent 26d4aa7 commit f994db1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ test-openshift: script_env += TEST_OPENSHIFT_MODE=true
test-openshift: tag
VERSIONS="$(VERSIONS)" BASE_IMAGE_NAME="$(BASE_IMAGE_NAME)" $(script_env) $(test)

.PHONY: test-openshift-pytest
test-openshift-pytest: script_env += TEST_OPENSHIFT_PYTEST=true
test-openshift-pytest: tag
VERSIONS="$(VERSIONS)" BASE_IMAGE_NAME="$(BASE_IMAGE_NAME)" $(script_env) $(test)


.PHONY: shellcheck
shellcheck:
$(shellcheck) $(SHELLCHECK_FILES)
Expand Down
14 changes: 12 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ for dir in ${VERSIONS}; do
if [ -e ".exclude-openshift" ]; then
echo "-> .exclude-openshift file exists for version $dir, skipping OpenShift-4 tests."
else
if [[ -x test/run-openshift-remote-cluster ]]; then
if [ -x test/run-openshift-remote-cluster ]; then
VERSION=$dir test/run-openshift-remote-cluster
failed_version "$?" "$dir"
else
Expand All @@ -68,13 +68,23 @@ for dir in ${VERSIONS}; do
fi

if [ -n "${TEST_UPSTREAM}" ]; then
if [[ -x test/run-upstream ]]; then
if [ -x test/run-upstream ]; then
VERSION=$dir test/run-upstream
failed_version "$?" "$dir"
else
echo "-> Upstream tests are not present, skipping"
fi
fi

if [ -n "${TEST_OPENSHIFT_PYTEST}" ]; then
if [ -x test/run-openshift-pytest ]; then
VERSION=$dir test/run-openshift-pytest
failed_version "$?" "$dir"
else
echo "-> PyTest tests are not present, skipping"
fi
fi

popd > /dev/null || exit 1
done

Expand Down

0 comments on commit f994db1

Please sign in to comment.