Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ci-automation/ci-config.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ GC_BUCKET="flatcar-linux"

DEFAULT_HTTP_IMAGE_URL_TEMPLATE="@PROTO@://${BUILDCACHE_SERVER}/images/@ARCH@/@VERNUM@"

if ! command -v zstd > /dev/null; then
# we require zstd and it is included by default on flatcar
echo >&2 "zstd could not be found. unpacking container image may fail."
fi

CI_GIT_AUTHOR="flatcar-ci"
CI_GIT_EMAIL="infra+ci@flatcar-linux.org"

Expand Down
12 changes: 9 additions & 3 deletions ci-automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ function _test_run_impl() {
local tests_escaped=()
__escape_multiple tests_escaped "${@}"

# Remove the old results first
rm -f ${tests_dir}/*-run-1.* || true
# Vendor tests may need to know if it is a first run or a rerun
touch "${work_dir}/first_run"
for retry in $(seq "${retries}"); do
Expand All @@ -171,14 +173,18 @@ function _test_run_impl() {
touch sdk_container/.env
docker run --pull always --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
-w /work -v "$PWD":/work "${MANTLE_REF}" \
bash -c "git config --global --add safe.directory /work && \
source sdk_container/.env && \
bash -c "source sdk_container/.env && \
ci-automation/vendor-testing/${image_escaped}.sh ${common_test_args_escaped[*]} ${tapfile_escaped} ${tests_escaped[*]}"
set -e
rm -f "${work_dir}/first_run"

[[ -s "${tests_dir}/${tapfile}" ]] || {
echo "ERROR: something went wrong, result is empty: ${tests_dir}/${tapfile}"
break
}

# Note: git safe.directory is not set in this run as it does not use git
docker run --pull always --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
docker run --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
-w /work -v "$PWD":/work "${MANTLE_REF}" \
ci-automation/test_update_reruns.sh \
"${arch}" "${vernum}" "${image}" "${retry}" \
Expand Down
45 changes: 45 additions & 0 deletions run_local_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
# The devcontainer tests will be skipped since these require a valid commit ref in
# the upstream scripts repo.
#
# Usage:
# ./run_local_tests.sh [ARCH] [PARALLEL] [TEST ...]
#
# ARCH : Machine architecture to test (default: amd64)
# PARALLEL : Number of parallel tests (default: 2)
# TEST ... : Optional list of kola tests/globs to run. If omitted,
# all suitable qemu_uefi tests (except devcontainer) are run
# and qemu_update tests are executed as well.
#
#
# Helper options:
# -h, --help : Show this help and exit.
# --list-tests : List all qemu/qemu_update tests that would be run by
# default (excluding devcontainer tests) and exit.
#
# Requirements:
# - Docker (for running the Mantle container).
#
Expand Down Expand Up @@ -63,6 +78,23 @@ EOF
}
#--

function usage() {
cat <<EOF
Usage: ./run_local_tests.sh [ARCH] [PARALLEL] [TEST ...]

ARCH : Machine architecture to test (default: amd64)
PARALLEL : Number of parallel tests (default: 2)
TEST ... : Optional list of kola tests/globs to run. If omitted,
all suitable qemu_uefi tests (except devcontainer) are run
and qemu_update tests are executed as well.
Helper options:
-h, --help : Show this help and exit.
--list-tests : List all qemu/qemu_update tests that would be run by
default (excluding devcontainer tests) and exit.
EOF
}
#--

function run_local_tests() (
local arch="${1:-amd64}"
if [[ $# -gt 0 ]] ; then shift; fi
Expand Down Expand Up @@ -120,5 +152,18 @@ function run_local_tests() (

if [[ "$(basename "${0}")" = "run_local_tests.sh" ]] ; then
set -euo pipefail
case "${1:-}" in
-h|--help)
usage
exit 0
;;
--list-tests)
# List all tests that would be run by default and exit.
mantle_container="$(cat "sdk_container/.repo/manifests/mantle-container")"
docker run "${mantle_container}" kola list --platform qemu
exit 0
;;
esac

run_local_tests "${@}"
fi