mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-13 13:06:51 +00:00
Include tests for default_setup
This commit is contained in:
39
hack/e2e-test.sh
Normal file → Executable file
39
hack/e2e-test.sh
Normal file → Executable file
@@ -6,14 +6,51 @@ DIR="$(realpath "${DIR}")"
|
||||
|
||||
TEST_DIR="$(realpath "${DIR}/../test/actions.github.com")"
|
||||
|
||||
export PLATFORMS="linux/amd64"
|
||||
|
||||
TARGETS=()
|
||||
|
||||
function set_targets() {
|
||||
local cases="$(find "${TEST_DIR}" -name '*.test.sh' | sort | sed -e 's/\(.*\)/test_\1\.sh/')"
|
||||
local cases="$(find "${TEST_DIR}" -name '*.test.sh' | sed "s#^${TEST_DIR}/##g" )"
|
||||
|
||||
mapfile -t TARGETS < <(echo "${cases}")
|
||||
|
||||
echo $TARGETS
|
||||
}
|
||||
|
||||
function main() {
|
||||
local failed=()
|
||||
|
||||
for target in "${TARGETS[@]}"; do
|
||||
echo "============================================================"
|
||||
test="${TEST_DIR}/${target}"
|
||||
if [[ ! -x "${test}" ]]; then
|
||||
echo "Error: test ${test} is not executable or not found"
|
||||
failed+=("${test}")
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Running test ${target}"
|
||||
if ! "${test}"; then
|
||||
failed+=("${target}")
|
||||
echo "---------------------------------"
|
||||
echo "FAILED: ${target}"
|
||||
else
|
||||
echo "---------------------------------"
|
||||
echo "PASSED: ${target}"
|
||||
fi
|
||||
echo "============================================================"
|
||||
done
|
||||
|
||||
if [[ "${#failed[@]}" -gt 0 ]]; then
|
||||
echo "Failed tests:"
|
||||
for fail in "${failed[@]}"; do
|
||||
echo " ${fail}"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_targets
|
||||
|
||||
main
|
||||
|
||||
Reference in New Issue
Block a user