mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
On the EC2 setup there won't be a Git cache for pixel tests so every test run would pull pixels.
84 lines
3.2 KiB
Bash
Executable file
84 lines
3.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# This is the expected entry point for Cockpit CI; will be called without
|
|
# arguments but with an appropriate $TEST_OS, and optionally $TEST_SCENARIO
|
|
|
|
# Currently supported scenarios:
|
|
# devel - runs tests with coverage enabled and generates a html file
|
|
# with coverage information and `NODE_ENV=development`
|
|
# to get additional React checks and useful stack traces.
|
|
# firefox - runs tests using the Firefox browser instead of Chrome
|
|
# networking - networking related tests
|
|
# storage - storage related tests
|
|
# expensive - expensive tests (usually tests which reboot/generate a new initramfs)
|
|
# other - non-networking/storage/expensive tests
|
|
# daily - runs tests with dnf-nightly and udisks-daily repositories enabled
|
|
# updates-testing - runs tests with updates-testing installed
|
|
|
|
set -eu
|
|
|
|
test/common/make-bots
|
|
if [ "$(cat test/reference-image)" = "$TEST_OS" ]; then
|
|
test/common/pixel-tests pull
|
|
fi
|
|
|
|
PREPARE_OPTS=""
|
|
RUN_OPTS=""
|
|
ALL_TESTS="$(test/common/run-tests --test-dir test/verify -l)"
|
|
|
|
RE_NETWORKING='Networking|Bonding|Connection|TestBridge|WireGuard|Firewall|Team|IPA|AD|Kerberos'
|
|
RE_STORAGE='Storage'
|
|
RE_EXPENSIVE='HostSwitching|MultiMachine|Updates|Superuser|Kdump|Pages'
|
|
|
|
# every known case needs to set RUN_OPTS to something non-empty, so that we can check if we hit any branch
|
|
case "${TEST_SCENARIO:=}" in
|
|
*devel*) RUN_OPTS="$RUN_OPTS --coverage"; export NODE_ENV=development ;;&
|
|
*firefox*) RUN_OPTS="$RUN_OPTS "; export TEST_BROWSER=firefox ;;&
|
|
|
|
*daily*)
|
|
bots/image-customize --fresh -v --script test/vm.daily "$TEST_OS"
|
|
RUN_OPTS="$RUN_OPTS "
|
|
PREPARE_OPTS="$PREPARE_OPTS --overlay"
|
|
;;&
|
|
*updates-testing*)
|
|
bots/image-customize --fresh -v --script test/vm.updates-testing "$TEST_OS"
|
|
RUN_OPTS="$RUN_OPTS "
|
|
PREPARE_OPTS="$PREPARE_OPTS --overlay"
|
|
;;&
|
|
|
|
# split tests into roughly equal scenarios for more parallelism
|
|
# one of them needs to run the unit tests and lintian (on Debian/Ubuntu), pick the fastest one (networking)
|
|
*networking*)
|
|
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -E "$RE_NETWORKING")"
|
|
;;&
|
|
*storage*)
|
|
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -E "$RE_STORAGE")"
|
|
PREPARE_OPTS="$PREPARE_OPTS --quick"
|
|
;;&
|
|
*expensive*)
|
|
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -E "$RE_EXPENSIVE")"
|
|
PREPARE_OPTS="$PREPARE_OPTS --quick"
|
|
;;&
|
|
*other*)
|
|
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -Ev "$RE_NETWORKING|$RE_STORAGE|$RE_EXPENSIVE")"
|
|
PREPARE_OPTS="$PREPARE_OPTS --quick"
|
|
;;&
|
|
*ws-container*)
|
|
PREPARE_OPTS="$PREPARE_OPTS --quick --container"
|
|
RUN_OPTS="$RUN_OPTS "
|
|
;;&
|
|
|
|
esac
|
|
|
|
# these are too volatile/ungated, we can't keep up with reporting issues
|
|
if [ "${TEST_OS#fedora}" != "$TEST_OS" ] || [ "$TEST_OS" = "centos-10" ]; then
|
|
export TEST_AUDIT_NO_SELINUX=1
|
|
fi
|
|
|
|
if [ -n "$TEST_SCENARIO" ] && [ -z "$RUN_OPTS" ]; then
|
|
echo "Unknown test scenario: $TEST_SCENARIO"
|
|
exit 1
|
|
fi
|
|
|
|
test/image-prepare --verbose ${PREPARE_OPTS} "$TEST_OS"
|
|
test/common/run-tests --test-dir test/verify --track-naughties ${RUN_OPTS}
|