@@ -55,6 +55,7 @@ REQUIREMENTS := test-requirements.txt requirements.txt
5555
5656# Pin common pip version here across all the targets
5757# Note! Periodic maintenance pip upgrades are required to be up-to-date with the latest pip security fixes and updates
58+ # 202403: Use pip 24.0 which is the highest supported version across Python 3.8 - 3.10
5859PIP_VERSION ?= 24.0
5960SETUPTOOLS_VERSION ?= 69.5.1
6061PIP_OPTIONS := $(ST2_PIP_OPTIONS )
7374# The minus in front of st2.st2common.bootstrap filters out logging statements from that module.
7475# See https://nose.readthedocs.io/en/latest/usage.html#cmdoption-logging-filter
7576NOSE_OPTS := --rednose --immediate --with-parallel --parallel-strategy=FILE --nocapture --logging-filter=-st2.st2common.bootstrap
77+ # https://github.com/pytest-dev/pytest-xdist/issues/71
78+ # PYTEST_OPTS := -n auto --tx 2*popen//execmodel=eventlet
79+ PYTEST_OPTS := ""
7680
7781ifndef NOSE_TIME
7882 NOSE_TIME := yes
@@ -486,7 +490,7 @@ flake8: requirements .flake8
486490 . $(VIRTUALENV_DIR ) /bin/activate; flake8 --config ./lint-configs/python/.flake8 pylint_plugins/
487491
488492# Make task which verifies st2client README will parse pypi checks
489- . PHONY : .st2client-pypi-check
493+ .PHONY : .st2client-pypi-check
490494.st2client-pypi-check :
491495 @echo
492496 @echo " ==================== st2client pypi check ===================="
@@ -824,8 +828,7 @@ unit-tests: requirements .unit-tests
824828 echo " Running tests in" $$ component; \
825829 echo " -----------------------------------------------------------" ; \
826830 . $(VIRTUALENV_DIR ) /bin/activate; \
827- nosetests $(NOSE_OPTS ) -s -v \
828- $$ component/tests/unit || (( failed+= 1 )) ; \
831+ pytest --capture=no --verbose $$ component/tests/unit || exit 1; \
829832 echo " -----------------------------------------------------------" ; \
830833 echo " Done running tests in" $$ component; \
831834 echo " ===========================================================" ; \
@@ -849,9 +852,8 @@ endif
849852 echo " -----------------------------------------------------------" ; \
850853 . $(VIRTUALENV_DIR ) /bin/activate; \
851854 COVERAGE_FILE=.coverage.unit.$$(echo $$component | tr '/' '.' ) \
852- nosetests $(NOSE_OPTS ) -s -v $(NOSE_COVERAGE_FLAGS ) \
853- $(NOSE_COVERAGE_PACKAGES ) \
854- $$ component/tests/unit || (( failed+= 1 )) ; \
855+ pytest --capture=no --verbose $(PYTEST_OPTS ) --cov=$$ component --cov-branch \
856+ $$ component/tests/unit || exit 1; \
855857 echo " -----------------------------------------------------------" ; \
856858 echo " Done running tests in" $$ component; \
857859 echo " ===========================================================" ; \
@@ -907,8 +909,8 @@ itests: requirements .itests
907909 echo " Running integration tests in" $$ component; \
908910 echo " -----------------------------------------------------------" ; \
909911 . $(VIRTUALENV_DIR ) /bin/activate; \
910- nosetests $( NOSE_OPTS ) -s -v \
911- $$ component/tests/integration || (( failed += 1 )) ; \
912+ pytest --capture=no --verbose $( PYTEST_OPTS ) \
913+ $$ component/tests/integration || exit 1 ; \
912914 echo " -----------------------------------------------------------" ; \
913915 echo " Done running integration tests in" $$ component; \
914916 echo " ===========================================================" ; \
@@ -932,9 +934,8 @@ endif
932934 echo " -----------------------------------------------------------" ; \
933935 . $(VIRTUALENV_DIR ) /bin/activate; \
934936 COVERAGE_FILE=.coverage.integration.$$(echo $$component | tr '/' '.' ) \
935- nosetests $(NOSE_OPTS ) -s -v $(NOSE_COVERAGE_FLAGS ) \
936- $(NOSE_COVERAGE_PACKAGES ) \
937- $$ component/tests/integration || (( failed+= 1 )) ; \
937+ pytest --capture=no --verbose $(PYTEST_OPTS ) --cov=$$ component --cov-branch \
938+ $$ component/tests/integration || exit 1; \
938939 echo " -----------------------------------------------------------" ; \
939940 echo " Done integration running tests in" $$ component; \
940941 echo " ===========================================================" ; \
@@ -1032,16 +1033,15 @@ orquesta-itests: requirements .orquesta-itests
10321033 @echo " ==================== Orquesta integration tests ===================="
10331034 @echo " The tests assume st2 is running on 127.0.0.1."
10341035 @echo
1035- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $( NOSE_OPTS ) -s -v st2tests/integration/orquesta || exit 1;
1036+ . $(VIRTUALENV_DIR ) /bin/activate; pytest --capture=no --verbose $( PYTEST_OPTS ) st2tests/integration/orquesta || exit 1;
10361037
10371038.PHONY : .orquesta-itests-coverage-html
10381039.orquesta-itests-coverage-html :
10391040 @echo
10401041 @echo " ==================== Orquesta integration tests with coverage (HTML reports) ===================="
10411042 @echo " The tests assume st2 is running on 127.0.0.1."
10421043 @echo
1043- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $(NOSE_OPTS ) -s -v --with-coverage \
1044- --cover-inclusive --cover-html st2tests/integration/orquesta || exit 1;
1044+ . $(VIRTUALENV_DIR ) /bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS ) --cov=orquesta --cov-branch st2tests/integration/orquesta || exit 1;
10451045
10461046.PHONY : packs-tests
10471047packs-tests : requirements .packs-tests
@@ -1071,7 +1071,7 @@ runners-tests: requirements .runners-tests
10711071 echo " ===========================================================" ; \
10721072 echo " Running tests in" $$ component; \
10731073 echo " ===========================================================" ; \
1074- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $( NOSE_OPTS ) -s -v $$ component/tests/unit || (( failed += 1 )) ; \
1074+ . $(VIRTUALENV_DIR ) /bin/activate; pytest --capture=no --verbose $( PYTEST_OPTS ) $$ component/tests/unit || exit 1 ; \
10751075 done ; \
10761076 if [ $$ failed -gt 0 ]; then exit 1; fi
10771077
@@ -1089,7 +1089,7 @@ runners-itests: requirements .runners-itests
10891089 echo " ===========================================================" ; \
10901090 echo " Running integration tests in" $$ component; \
10911091 echo " ===========================================================" ; \
1092- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $( NOSE_OPTS ) -s -v $$ component/tests/integration || (( failed += 1 )) ; \
1092+ . $(VIRTUALENV_DIR ) /bin/activate; pytest --capture=no --verbose $( PYTEST_OPTS ) $$ component/tests/integration || exit 1 ; \
10931093 done ; \
10941094 if [ $$ failed -gt 0 ]; then exit 1; fi
10951095
@@ -1104,8 +1104,8 @@ runners-itests: requirements .runners-itests
11041104 echo " ===========================================================" ; \
11051105 echo " Running integration tests in" $$ component; \
11061106 echo " ===========================================================" ; \
1107- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $( NOSE_OPTS ) -s -v --with-coverage \
1108- --cover-inclusive --cover-html $$ component/tests/integration || (( failed += 1 )) ; \
1107+ . $(VIRTUALENV_DIR ) /bin/activate; pytest --capture=no --verbose $( PYTEST_OPTS ) --cov= $$ component --cov-report=html \
1108+ $$ component/tests/integration || exit 1 ; \
11091109 done ; \
11101110 if [ $$ failed -gt 0 ]; then exit 1; fi
11111111
0 commit comments