From ddf792438c2d04e198de52ef3f4367786c0da9c0 Mon Sep 17 00:00:00 2001 From: Rodrigo Barbieri Date: Fri, 13 Sep 2024 12:13:43 -0300 Subject: [PATCH] review changes --- .../tools/charmed_openstack_functest_runner.sh | 2 +- .../func_test_tools/manual_functests_runner.sh | 17 +++++++++++++++++ tox.ini | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/openstack/tools/charmed_openstack_functest_runner.sh b/openstack/tools/charmed_openstack_functest_runner.sh index a3b33da3..50465dc3 100755 --- a/openstack/tools/charmed_openstack_functest_runner.sh +++ b/openstack/tools/charmed_openstack_functest_runner.sh @@ -40,7 +40,7 @@ OPTIONS: By default we wait before destroying the model after a test run. This flag can used to override that behaviour. --manual-functests - Runs functest commands separately (deploy,configure,test)instead of + Runs functest commands separately (deploy,configure,test) instead of the entire suite. --remote-build Builds the charm in a remote location and transfers the charm file over. diff --git a/openstack/tools/func_test_tools/manual_functests_runner.sh b/openstack/tools/func_test_tools/manual_functests_runner.sh index 77cda85d..f2c3d1ae 100755 --- a/openstack/tools/func_test_tools/manual_functests_runner.sh +++ b/openstack/tools/func_test_tools/manual_functests_runner.sh @@ -1,5 +1,20 @@ #!/bin/bash -eu +# This file assists the main charmed_functest_runner script but can also be invoked separately +# by passing the target (jammy-antelope, focal-yoga, etc) to run and a sleep timer between the +# configure and test run. If run manually, the .charm file must exist in the source code folder +# and the environment variables need to have been exported prior to invoking this script. +# +# What this script does is run the functions functest-deploy, functest-configure and +# functest-test separately one after the other, instead of the entire suite run in the +# same command that the command functest-target does. +# +# The main advantages of this is that it is easier for debugging, and it can also help +# when there are race conditions running the charm test (by using the sleep parameter). +# +# Ideally, all those issues should be worked out in zaza, but having this alternative +# makes it easier for debugging, testing, and validating the race condition. + TARGET=$1 SLEEP=$2 @@ -9,6 +24,8 @@ fi juju add-model test-$TARGET --no-switch +# Those below are the parameters that are used when functest-target creates a model named "zaza-" + juju model-config -m test-$TARGET test-mode=true transmit-vendor-metrics=false enable-os-upgrade=false default-series=jammy automatically-retry-hooks=false source ./.tox/func-noop/bin/activate diff --git a/tox.ini b/tox.ini index c152f6d0..f311754a 100644 --- a/tox.ini +++ b/tox.ini @@ -59,6 +59,7 @@ bashfiles = {toxinidir}/openstack/tools/upload_octavia_amphora_image.sh {toxinidir}/openstack/tools/install_local_ca.sh {toxinidir}/openstack/tools/charmed_openstack_functest_runner.sh + {toxinidir}/openstack/tools/func_test_tools/manual_functests_runner.sh {toxinidir}/openstack/tools/instance_launch.sh {toxinidir}/openstack/tools/setup_tempest.sh {toxinidir}/openstack/tools/create_octavia_lb.sh