diff --git a/docs/ci.md b/docs/ci.md index 61871e7..910b93f 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -102,6 +102,66 @@ all step results. Local YAML/shell checks do not prove that a particular Gitea instance, runner registration, network policy or resource allocation can complete this job. +### Tests under the job image + +The test step runs as **root** in an Ubuntu 24.04 container +(`docker.gitea.com/runner-images:ubuntu-24.04`, `HOME=/root`) to which only +the apt packages of the system-dependencies action are added. A test that +assumes a developer machine fails there, and a run takes about an hour, so +check a change to the tests the way CI runs them, with every failing test of +every crate listed in one go (`--no-fail-fast`): + +```sh +# Root owns what the container writes: keep it in a directory of its own. +mkdir -p .scratch +docker run --rm -v "$PWD":/src -w /src -e HOME=/root \ + -e CARGO_HOME=/src/.scratch/cargo -e RUSTUP_HOME=/src/.scratch/rustup \ + -e CARGO_TARGET_DIR=/src/.scratch/target \ + docker.gitea.com/runner-images:ubuntu-24.04 bash -c ' + apt-get update && apt-get install -y --no-install-recommends \ + build-essential ca-certificates cmake curl git jq pkg-config python3 \ + libasound2-dev libfontconfig1-dev libxkbcommon-dev libvpx-dev \ + libdav1d-dev libpipewire-0.3-dev libspa-0.2-dev libclang-dev xvfb xauth + curl --proto =https --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- -y --profile minimal --default-toolchain none + . "$CARGO_HOME/env" && rustup toolchain install + xvfb-run -a bash -c "VOELIN_X11_TEST_DISPLAY=\$DISPLAY \ + cargo test --workspace --locked --no-fail-fast"' +``` + +The private VoelinProtocol dependency needs the deploy key +([below](#voelinprotocol-access)); without it, point git at a local bare +clone of that repository with +`git config --global url."file:///path/to/VoelinProtocol.git".insteadOf +ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git` and +`CARGO_NET_GIT_FETCH_WITH_CLI=true`, which leaves `Cargo.lock` as it is. + +What the image lacks, and what the tests do about it. A test that is about +the missing piece prints `skipped: ` (or is `#[ignore]`d with the +reason) and passes; any other test does not need the piece. + +| The image has no | Tests | +|---|---| +| Regular user (root writes anywhere and creates missing directories) | Nothing relies on a permission bit or a missing directory failing. A path that cannot be written is built from something that fails for root too: below a regular file (`ENOTDIR`) or naming a directory (`EISDIR`), as `an_unwritable_path_fails_at_once` of the recorder does. | +| Sound card (`/dev/snd`), PipeWire and WirePlumber daemons | `libpipewire` and ALSA are there to build against only. `tests/pipewire_apps.rs` needs `pipewire`, `wireplumber` and `dbus-daemon` and prints `skipped: needs pipewire, wireplumber and dbus-daemon`. The camera tests are `#[ignore]`d (a camera and PipeWire). | +| D-Bus session bus | `voelin-platform`'s portal proxy test returns with `no session bus: run under dbus-run-session`; the notification and capture-portal tests run only where no bus is configured, and check that talking to a missing service fails cleanly. | +| GPU, `/dev/dri`, VA-API, `/dev/udmabuf` | The VA-API and DMA-BUF tests print `no usable h264_vaapi, skipped`, `no /dev/udmabuf, skipped` or `no VA-API surfaces to export, skipped`. | +| FFmpeg libraries, `ffmpeg` and `ffprobe` | The FFmpeg tests of `voelin-media` print `FFmpeg not available (…), skipped`. The studio tests that read a recording back with `ffprobe` write and check the file themselves and skip only the `ffprobe` check; the RTMP tests need all three and skip. | +| H.264 encoder (no FFmpeg, no GPU, no OpenH264 library: `VOELIN_OPENH264_LIB` is unset and the download tests are `#[ignore]`d) | Tests that need an H.264 encoder print `no H.264 encoder on this machine`. Tests of codec choice state what `preferred_codec` promises with whatever the machine can encode. VP8 and VP9 (libvpx) are built in, so their round trips run. | +| X11 or Wayland display | `xvfb-run` supplies one X11 display and the step hands it over as `VOELIN_X11_TEST_DISPLAY` to the X11 capture and hotkey tests. `VOELIN_WLROOTS_TEST_DISPLAY` is unset, so the wlroots capture test prints `skipped`. | +| Playwright and Chromium (the image has Node) | The browser interop tests print `skipped: set VOELIN_INTEROP=1 (needs node, Playwright and Chromium)`. | +| TeamSpeak dev servers | The live tests print `skipped: set VOELIN_LIVE=1 with the dev servers running` or are `#[ignore]`d. | +| DNS and internet for the tests | Tests that resolve real names or download are `#[ignore]`d with the reason. | + +`localhost` resolves to `::1` first in this image (it also has `127.0.0.1`), +and the tests that reach a server bound to `127.0.0.1` through `localhost` +pass because the connection to `::1` is refused at once. On a machine where +connections to `::1` hang instead (a development machine with a VPN does +that), two `voelin-core` tests fail whatever the change under test is: +`discover::tests::without_records_the_gateway_itself_is_asked` and +`web::tests::pictures_go_through_the_proxy_named_for_each_hop`. That is a +property of that machine, not of the image. + ### VoelinProtocol access The workspace depends on `voelin-identity` from the **private** repository