1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:07:44 +00:00

Base/CI: Boot serenity in CI in a mode that runs tests on target

Build a new version of Serenity in CI that doesn't have all the debug
symbols on, or we'd be waiting a very long time to boot.

Insert a TestRunner entry into SystemServer.ini that will run a shell
script that runs tests in /bin and /usr/Tests and shuts down the system
in the new self-test boot mode. Also make sure enough basic services are
started in self-test such that the tests will actually run properly.
This commit is contained in:
Andrew Kaster 2021-02-03 19:04:22 -07:00 committed by Andreas Kling
parent 5046213556
commit 611bbc43be
4 changed files with 155 additions and 63 deletions

View file

@ -4,7 +4,7 @@ SocketPermissions=660
Lazy=1
Priority=low
User=protocol
BootModes=text,graphical
BootModes=text,graphical,self-test
MultiInstance=1
AcceptSocketConnections=1
@ -39,13 +39,13 @@ Lazy=1
Priority=low
KeepAlive=1
User=lookup
BootModes=text,graphical
BootModes=text,graphical,self-test
[DHCPClient]
Priority=low
KeepAlive=1
User=root
BootModes=text,graphical
BootModes=text,graphical,self-test
[NotificationServer]
Socket=/tmp/portal/notify
@ -175,3 +175,11 @@ AcceptSocketConnections=1
Executable=/bin/CrashDaemon
KeepAlive=1
User=anon
[TestRunner@ttyS0]
Executable=/home/anon/tests/run-tests-and-shutdown.sh
StdIO=/dev/ttyS0
Environment=DO_SHUTDOWN_AFTER_TESTS=1 TERM=xterm PATH=/bin:/usr/bin:/usr/local/bin
User=anon
WorkingDirectory=/home/anon
BootModes=self-test

View file

@ -0,0 +1,30 @@
#!/bin/sh
echo "==== Running Tests on SerenityOS ===="
run() {
test_cmd=($*)
echo "Running test -- $test_cmd"
if $test_cmd {
echo "::debug file=$test_cmd:: $test_cmd passed!"
} else {
echo "::error file=$test_cmd:: $test_cmd returned non-zero exit code, check logs!"
}
}
# TODO: It'd be nice to have a list+list op (as opposed to nest-on-in-another)
# TODO: It'd be nice to have a list.length or enumerate(list) operation to allow terminal progress bar
# TODO: test-web requires the window server
system_tests=(test-js test-pthread test-compress (test-crypto bigint -t))
# FIXME: Running too much at once is likely to run into #5541. Remove commented out find below when stable
all_tests=($system_tests) #$(find /usr/Tests -type f | grep -v Kernel | grep -v .inc | shuf))
for list in $all_tests {
for $list { run $it }
}
echo "==== Done running tests ===="
if test $DO_SHUTDOWN_AFTER_TESTS {
shutdown -n
}