Skip to content

Commit

Permalink
Support any test-requirements when applying func test pr
Browse files Browse the repository at this point in the history
Upstream zosci config tries different formats and locations since
the charms are not consistent in how they do this so we mirror that
behaviour here.
  • Loading branch information
dosaboy committed Oct 6, 2024
1 parent 442de0c commit 80bd9a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
7 changes: 1 addition & 6 deletions openstack/tools/charmed_openstack_functest_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,7 @@ fi

# If a func test pr is provided switch to that pr.
if [[ -n $FUNC_TEST_PR ]]; then
(
[[ -d src ]] && cd src
# We use the zosci-config tools to do this.
MSG=$(echo "Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/$FUNC_TEST_PR"| base64)
~/zosci-config/roles/handle-func-test-pr/files/process_func_test_pr.py -f ./test-requirements.txt "$MSG"
)
apply_func_test_pr $FUNC_TEST_PR
fi

declare -A func_target_state=()
Expand Down
12 changes: 12 additions & 0 deletions openstack/tools/func_test_tools/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,16 @@ get_and_update_repo ()
git clone $url
fi
)
}

apply_func_test_pr ()
{
# Similar to https://github.com/openstack-charmers/zosci-config/blob/master/roles/handle-func-test-pr/tasks/main.yaml#L19
local pr_id=$1
# We use the zosci-config tools to do this.
local msg=$(echo "Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/$pr_id"| base64)
~/zosci-config/roles/handle-func-test-pr/files/process_func_test_pr.py \
-f './test-requirements*.txt' \
-f './src/test-requirements*.txt' \
"$msg"
}
4 changes: 1 addition & 3 deletions openstack/tools/openstack_regression_tests_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ LOGFILE=$(mktemp --suffix=-openstack-release-test-results)

# If a func test pr is provided switch to that pr.
if [[ -n $FUNC_TEST_PR ]]; then
# We use the zosci-config tools to do this.
MSG=$(echo "Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/$FUNC_TEST_PR"| base64)
~/zosci-config/roles/handle-func-test-pr/files/process_func_test_pr.py -f ./test-requirements.txt "$MSG"
apply_func_test_pr $FUNC_TEST_PR
fi

tox -re func-target -- $FUNC_TEST_TARGET || true
Expand Down

0 comments on commit 80bd9a7

Please sign in to comment.