Skip to content

Commit

Permalink
tests: introduce expensive scenario for the Fedora Plan tests
Browse files Browse the repository at this point in the history
Change some class names as these are expected to be unique.
  • Loading branch information
KKoukiou authored and martinpitt committed Jul 28, 2024
1 parent e6a0e40 commit 9998115
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bots: test/common
live-vm: bots $(UPDATES_IMG)
./test/webui_testvm.py $(TEST_LIVE_OS)

prepare-test-deps: bots test/common payload images
prepare-test-deps: bots test/common test/reference payload images

.PHONY: payload
payload: bots
Expand All @@ -198,12 +198,6 @@ create-updates.img: bots
-rm $(UPDATES_IMG)
make $(UPDATES_IMG)

# test runs in kernel_t context and triggers massive amounts of SELinux
# denials; SELinux gets disabled, but would still trigger unexpected messages
# we create huge VMs, so we need to reduce parallelism on CI
integration-test: prepare-test-deps test/reference $(UPDATES_IMG)
J=$$((TEST_JOBS/4)); [ $$J -ge 1 ] || J=1; TEST_AUDIT_NO_SELINUX=1 test/common/run-tests --jobs $$J

test/reference: test/common
test/common/pixel-tests pull

Expand Down
4 changes: 1 addition & 3 deletions test/anacondalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ def tearDown(self):
super().tearDown()


def test_plan(url):
def test_plan(_url):
def decorator(func):
func.test_plan_url = url
print(f"Test plan URL: {func.test_plan_url}")
return func
return decorator
44 changes: 42 additions & 2 deletions test/run
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
#! /bin/bash

# This is the expected entry point for Cockpit CI; will be called without
# arguments but with an appropriate $TEST_OS
# arguments but with an appropriate $TEST_OS, and optionally $TEST_SCENARIO

# Currently supported scenarios:
#
# expensive - expensive tests (test which run a full installation)
# other - non-expensive tests


set -eux

make codecheck
make integration-test
make prepare-test-deps
make create-updates.img

RUN_OPTS=""
ALL_TESTS="$(test/common/run-tests --test-dir test -l)"

RE_EXPENSIVE='FedoraPlans'

# 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
*expensive*)
RUN_OPTS="$(echo "$ALL_TESTS" | grep -E "$RE_EXPENSIVE")"
;;&
*other*)
RUN_OPTS="$(echo "$ALL_TESTS" | grep -Ev "$RE_EXPENSIVE")"
;;&
esac

if [ -n "$TEST_SCENARIO" ] && [ -z "$RUN_OPTS" ]; then
echo "Unknown test scenario: $TEST_SCENARIO"
exit 1
fi

# test runs in kernel_t context and triggers massive amounts of SELinux
# denials; SELinux gets disabled, but would still trigger unexpected messages
# we create huge VMs, so we need to reduce parallelism on CI
if [ -z "${TEST_JOBS-}" ]; then
TEST_JOBS=4
fi
if [ -z "${TEST_OS-}" ]; then
TEST_OS=fedora-rawhide-boot
fi
export TEST_JOBS TEST_OS
J=$(($TEST_JOBS/4)); [ $J -ge 1 ] || J=1; TEST_AUDIT_NO_SELINUX=1 test/common/run-tests --test-dir test/ --jobs $J $RUN_OPTS

0 comments on commit 9998115

Please sign in to comment.