tests: correct python usage in virtualenv
[vpp.git] / test / Makefile
index e49fe6b..bf5f911 100644 (file)
@@ -14,7 +14,6 @@ ifndef TEST_DIR
 endif
 
 export TEST_BR = $(TEST_DIR)
-export TEST_DOC_BR = $(TEST_DIR)/doc/build
 FAILED_DIR=/tmp/vpp-failed-unittests/
 VPP_TEST_DIRS=$(shell ls -d $(TEST_DIR) $(EXTERN_TESTS))
 
@@ -81,9 +80,9 @@ PYTHON_INTERP=$(PYTHON)
 endif
 
 PYTHON_VERSION=$(shell $(PYTHON_INTERP) -c 'import sys; print(sys.version_info.major)')
-PIP_VERSION=21.2.4
+PIP_VERSION=21.3.1
 # Keep in sync with requirements.txt
-PIP_TOOLS_VERSION=6.2.0
+PIP_TOOLS_VERSION=6.4.0
 PYTHON_DEPENDS=requirements-$(PYTHON_VERSION).txt
 SCAPY_SOURCE=$(shell find $(VENV_PATH)/lib/python* -name site-packages)
 BUILD_COV_DIR=$(TEST_BR)/coverage
@@ -104,19 +103,19 @@ $(PIP_TOOLS_INSTALL_DONE):
        @$(PYTHON_INTERP) -m venv $(VENV_PATH)
        # pip version pinning
        @bash -c "source $(VENV_PATH)/bin/activate && \
-                 $(PYTHON_INTERP) -m pip install pip===$(PIP_VERSION)"
+                 python3 -m pip install pip===$(PIP_VERSION)"
        @bash -c "source $(VENV_PATH)/bin/activate && \
-                 $(PYTHON_INTERP) -m pip install pip-tools===$(PIP_TOOLS_VERSION)"
+                 python3 -m pip install pip-tools===$(PIP_TOOLS_VERSION)"
        @touch $@
 
 $(PYTHON_DEPENDS): requirements.txt
        @bash -c "source $(VENV_PATH)/bin/activate && \
                  CUSTOM_COMPILE_COMMAND='make test-refresh-deps (or update requirements.txt)' \
-                 $(PYTHON_INTERP) -m piptools compile -q --generate-hashes requirements.txt --output-file $@"
+                 python3 -m piptools compile -q --generate-hashes requirements.txt --output-file $@"
 
 $(PIP_INSTALL_DONE): $(PIP_TOOLS_INSTALL_DONE) $(PYTHON_DEPENDS)
        @bash -c "source $(VENV_PATH)/bin/activate && \
-                 $(PYTHON_INTERP) -m piptools sync $(PYTHON_DEPENDS)"
+                 python3 -m piptools sync $(PYTHON_DEPENDS)"
        @touch $@
 
 $(PIP_PATCH_DONE): $(PIP_INSTALL_DONE)
@@ -131,7 +130,7 @@ $(PIP_PATCH_DONE): $(PIP_INSTALL_DONE)
        touch $@
 
 $(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE)
-       @bash -c "source $(VENV_PATH)/bin/activate && $(PYTHON_INTERP) -m pip install -e $(PAPI_PYTHON_SRC_DIR)"
+       @bash -c "source $(VENV_PATH)/bin/activate && python3 -m pip install -e $(PAPI_PYTHON_SRC_DIR)"
        @touch $@
 
 .PHONY: refresh-deps
@@ -158,8 +157,8 @@ ifeq ($(SANITY),no)
 SANITY_IMPORT_VPP_PAPI_CMD=true
 SANITY_RUN_VPP_CMD=true
 else
-SANITY_IMPORT_VPP_PAPI_CMD=source $(VENV_PATH)/bin/activate && $(PYTHON_INTERP) sanity_import_vpp_papi.py
-SANITY_RUN_VPP_CMD=source $(VENV_PATH)/bin/activate && $(PYTHON_INTERP) sanity_run_vpp.py
+SANITY_IMPORT_VPP_PAPI_CMD=source $(VENV_PATH)/bin/activate && python3 sanity_import_vpp_papi.py
+SANITY_RUN_VPP_CMD=source $(VENV_PATH)/bin/activate && python3 sanity_run_vpp.py
 endif
 
 ifndef TEST_JOBS
@@ -239,21 +238,6 @@ wipe: reset
        @rm -rf $(VENV_PATH)
        @rm -rf $(patsubst %,%/__pycache__, $(VPP_TEST_DIRS))
 
-$(TEST_DOC_BR): $(PIP_INSTALL_DONE)
-       @mkdir -p $@
-       @bash -c "source $(VENV_PATH)/bin/activate && make -C doc html"
-
-.PHONY: doc
-doc: $(PIP_PATCH_DONE) $(TEST_DOC_BR)
-       @echo
-       @echo "Test Documentation URL: $(TEST_DOC_BR)/html/index.html"
-       @echo "Run 'make test-wipe-doc test-doc' to rebuild the test docs"
-       @echo
-
-.PHONY: wipe-doc
-wipe-doc:
-       @rm -rf $(TEST_DOC_BR)
-
 $(BUILD_COV_DIR):
        @mkdir -p $@
 
@@ -279,16 +263,16 @@ wipe-papi:
        @rm -rf $(PAPI_INSTALL_DONE) $(PAPI_WIPE_DIST)
 
 .PHONY: wipe-all
-wipe-all: wipe wipe-papi wipe-doc wipe-cov
+wipe-all: wipe wipe-papi wipe-cov
        @rm -rf $(TEST_BR)
 
 .PHONY: checkstyle-diff
 checkstyle-diff: $(PIP_INSTALL_DONE)
        @bash -c "source $(VENV_PATH)/bin/activate &&\
-                 $(PYTHON_INTERP) -m pip install pycodestyle"
+                 python3 -m pip install pycodestyle"
        @bash -c "source $(VENV_PATH)/bin/activate &&\
-               cd $(WS_ROOT) && git diff --name-only --no-color --relative HEAD~1 ':!*.patch' | grep '.py$$' | xargs -n 1 -I XXX \
-               pycodestyle --show-source --ignore=W504,E126,E241,E226,E305,E704,E741,E722 -v XXX ||\
+               cd $(WS_ROOT) && git diff --name-only --no-color --relative HEAD~1 ':!*.patch' | grep '.py$$' | xargs -n 1 \
+               pycodestyle --show-source --ignore=W504,E126,E241,E226,E305,E704,E741,E722 -v ||\
                (echo \"*********************************************************************\" &&\
                 echo \"* Test framework PEP8 compliance check FAILED (checked changed files)\" &&\
                 echo \"*********************************************************************\" &&\
@@ -306,7 +290,7 @@ start-gdb: sanity
 .PHONY: checkstyle
 checkstyle: $(PIP_INSTALL_DONE)
        @bash -c "source $(VENV_PATH)/bin/activate &&\
-                 $(PYTHON_INTERP) -m pip install pycodestyle"
+                 python3 -m pip install pycodestyle"
        @bash -c "source $(VENV_PATH)/bin/activate &&\
                pycodestyle --show-source --ignore=W504,E126,E241,E226,E305,E704,E741,E722 -v *.py ||\
                (echo \"*******************************************************************\" &&\
@@ -333,9 +317,8 @@ help:
        @echo " test-gcov                      - build and run functional tests (gcov build)"
        @echo " test-wipe              - wipe (temporary) files generated by unit tests"
        @echo " test-wipe-cov          - wipe code coverage report for test framework"
-       @echo " test-wipe-doc          - wipe documentation for test framework"
        @echo " test-wipe-papi         - rebuild vpp_papi sources"
-       @echo " test-wipe-all          - wipe (temporary) files generated by unit tests, docs, and coverage"
+       @echo " test-wipe-all          - wipe (temporary) files generated by unit tests, and coverage"
        @echo " test-shell             - enter shell with test environment"
        @echo " test-shell-debug       - enter shell with test environment (debug build)"
        @echo " test-checkstyle        - check PEP8 compliance for test framework"
@@ -405,10 +388,6 @@ help:
        @echo " VPP_IN_GDB_NO_RMDIR=0  - don't remove existing tmp dir but fail instead"
        @echo " VPP_IN_GDB_CMDLINE=1   - add 'interactive' to VPP arguments to run with command line"
        @echo ""
-       @echo "Creating test documentation"
-       @echo " test-doc               - generate documentation for test framework"
-       @echo " test-wipe-doc          - wipe documentation for test framework"
-       @echo ""
        @echo "Creating test code coverage report"
        @echo " test-cov               - generate code coverage report for test framework"
        @echo " test-wipe-cov          - wipe code coverage report for test framework"