Enhance the test workflow scripts
This makes it so that tests can now: 1. Add additional values files to the test 2. That the post-install.sh script knows if the test passed or failed for better output 3. That the main test can be skipped in favor of a test provided one Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
committed by
Marco Franssen
parent
9e22d2c303
commit
490fe8f543
@@ -153,17 +153,23 @@ jobs:
|
|||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: |
|
run: |
|
||||||
export scenario="$(basename "${TEST_DIR}")"
|
export scenario="$(basename "${TEST_DIR}")"
|
||||||
|
export EXTRA_HELM_ARGS=""
|
||||||
[ "${scenario}" != "default" ] && kubectl create namespace "${scenario}"
|
[ "${scenario}" != "default" ] && kubectl create namespace "${scenario}"
|
||||||
post-install() {
|
post-install() {
|
||||||
[ -x "${TEST_DIR}/post-install.sh" ] && "${TEST_DIR}/post-install.sh"
|
[ -x "${TEST_DIR}/post-install.sh" ] && "${TEST_DIR}/post-install.sh" $1
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
trap 'post-install $? $LINENO' EXIT
|
trap 'post-install $? $LINENO' EXIT
|
||||||
[ -x "${TEST_DIR}/pre-install.sh" ] && "${TEST_DIR}/pre-install.sh"
|
[ -x "${TEST_DIR}/pre-install.sh" ] && "${TEST_DIR}/pre-install.sh"
|
||||||
|
[ -f "${TEST_DIR}/.env" ] && source "${TEST_DIR}/.env"
|
||||||
|
if [ -x {${TEST_DIR}/install.sh ]; then
|
||||||
|
./${TEST_DIR}/install.sh
|
||||||
|
else
|
||||||
ct install --debug \
|
ct install --debug \
|
||||||
--namespace "${scenario}" \
|
--namespace "${scenario}" \
|
||||||
--target-branch ${{ github.base_ref }} \
|
--target-branch ${{ github.base_ref }} \
|
||||||
--exclude-deprecated \
|
--exclude-deprecated \
|
||||||
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=${TEST_DIR}/values.yaml"') || '' }}
|
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=${TEST_DIR}/values.yaml ${EXTRA_HELM_ARGS}"') || '' }}
|
||||||
|
fi
|
||||||
env:
|
env:
|
||||||
TEST_DIR: .github/tests/${{ matrix.values }}
|
TEST_DIR: .github/tests/${{ matrix.values }}
|
||||||
|
|||||||
Reference in New Issue
Block a user