From 1198ea50d54fc4aeeb8cd31a175536e2ddaab18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Mon, 5 Jun 2023 15:09:13 +0200 Subject: [PATCH 1/2] Add a sanity test of install_vm.py This test will check if the install_vm.py script is able to execute. This test can help prevent problems like https://github.com/ComplianceAsCode/content/issues/10650 --- tests/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2be3bbd8cea..8a9d0bc026f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -352,3 +352,9 @@ if (PY_CMAKELINT) COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "cmakelint" --config "${CMAKE_SOURCE_DIR}/.cmakelintrc" ${CMAKELINT_FILES} ) endif() + +add_test( + NAME "install-vm" + COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/install_vm.py" "--help" +) +set_tests_properties("install-vm" PROPERTIES LABELS quick) From b4472d3b20f7dd5364c7f11d91001ee7beaa7973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Mon, 5 Jun 2023 15:42:23 +0200 Subject: [PATCH 2/2] Reduce the test install_vm to Python 3 --- tests/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8a9d0bc026f..218bc73c1fc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -353,8 +353,10 @@ if (PY_CMAKELINT) ) endif() -add_test( - NAME "install-vm" - COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/install_vm.py" "--help" -) -set_tests_properties("install-vm" PROPERTIES LABELS quick) +if (PYTHON_VERSION_MAJOR GREATER 2) + add_test( + NAME "install-vm" + COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tests/install_vm.py" "--help" + ) + set_tests_properties("install-vm" PROPERTIES LABELS quick) +endif()