From 0ff08bc9aa8dad162f6d7e0861c888ca47539c36 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 20 Apr 2024 12:40:46 +0900 Subject: [PATCH] tempest: Avoid unnecessary package installation When tempest should be installed from source, we don't (shouldn't) install tempest packages. Depends-on: https://review.opendev.org/916577 Change-Id: Ic22610b897f6e3de8d9d0de11cc387314cdb0d7b --- manifests/tempest.pp | 1 - run_tests.sh | 27 +++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/manifests/tempest.pp b/manifests/tempest.pp index 59b653a67..f8488f941 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -345,7 +345,6 @@ class openstack_integration::tempest ( img_disk_format => $image_format, compute_build_interval => 10, ca_certificates_file => $::openstack_integration::params::ca_bundle_cert_path, - manage_tests_packages => true, attach_encrypted_volume => $attach_encrypted_volume, tempest_workspace => '/tmp/openstack/tempest', run_ssh => true, diff --git a/run_tests.sh b/run_tests.sh index c38cef149..48aa7ec2f 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -205,6 +205,11 @@ fi # Added tempest specific values to common.yaml if [ "${TEMPEST_FROM_SOURCE,,}" = false ]; then echo "tempest::install_from_source: false" >> ${SCRIPT_DIR}/hiera/common.yaml + echo "tempest::manage_tests_packages: true" >> ${SCRIPT_DIR}/hiera/common.yaml + echo "tempest::magnum::manage_tests_packages: true" >> ${SCRIPT_DIR}/hiera/common.yaml +else + echo "tempest::manage_tests_packages: false" >> ${SCRIPT_DIR}/hiera/common.yaml + echo "tempest::magnum::manage_tests_packages: false" >> ${SCRIPT_DIR}/hiera/common.yaml fi # Run puppet and assert something changes. @@ -269,11 +274,6 @@ print_header 'Prepare Tempest' $SUDO touch /tmp/openstack/tempest/test-include-list.txt /tmp/openstack/tempest/test-exclude-list.txt $SUDO chown -R "$(id -u):$(id -g)" /tmp/openstack/tempest/ -if uses_debs; then - pkglist="tempest python3-stestr python3-os-testr python3-tempest" - $SUDO apt-get install -y $pkglist -fi - set +e # Select what to test: # Smoke suite @@ -370,10 +370,15 @@ if [ "${TEMPEST_FROM_SOURCE,,}" = true ]; then /tmp/openstack/tempest/run_tempest/bin/pip3 setup.py install popd + run_tempest/bin/pip3 install os-testr run_tempest/bin/stestr init export tempest_binary="run_tempest/bin/tempest" + export stestr="run_tempest/bin/stestr" + export subunit2html="run_tempest/bin/subunit2html" else export tempest_binary="/usr/bin/tempest" + export stestr="/usr/bin/stestr" + export subunit2html="/usr/bin/subunit2html" fi # List tempest version @@ -393,16 +398,10 @@ $tempest_binary run --include-list=/tmp/openstack/tempest/test-include-list.txt RESULT=$? set -e -if [ -d .testrepository ]; then - testr last --subunit > /tmp/openstack/tempest/testrepository.subunit -elif [ -d .stestr ]; then - if type "stestr-3" 2>/dev/null; then - stestr-3 last --subunit > /tmp/openstack/tempest/testrepository.subunit - else - stestr last --subunit > /tmp/openstack/tempest/testrepository.subunit - fi +if [ -d .stestr ]; then + $stestr last --subunit > /tmp/openstack/tempest/testrepository.subunit fi -subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html +$subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html print_header 'SELinux Alerts (Tempest)' #catch_selinux_alerts