ci: speed up builds 4x with parallel tests, coverage, and ccache
All checks were successful
CI Code / Check spelling (push) Successful in 18s
CI Code / Check coding style (push) Successful in 31s
CI Code / Code Coverage (push) Successful in 15m25s
CI Code / Linux (debian) (push) Successful in 15m57s
CI Code / Linux (ubuntu) (push) Successful in 16m0s
CI Code / Linux (arch) (push) Successful in 16m6s
All checks were successful
CI Code / Check spelling (push) Successful in 18s
CI Code / Check coding style (push) Successful in 31s
CI Code / Code Coverage (push) Successful in 15m25s
CI Code / Linux (debian) (push) Successful in 15m57s
CI Code / Linux (ubuntu) (push) Successful in 16m0s
CI Code / Linux (arch) (push) Successful in 16m6s
Split functional tests into 4 parallel groups and add check-functional-parallel target (~3x faster CI runs). Add branch-aware LCOV coverage reporting with new --enable-coverage option and lcov summary in CI pipeline. Enable ccache via -C configure flag for faster recompilations. Install lcov in all Docker images and use --depth 1 git clones + parallel make -j$(nproc) for quicker container builds. Update CONTRIBUTING.md with instructions for parallel test groups and adding new ones. All changes are tightly related CI/performance improvements developed in sequence. No external service uploads (e.g. Codecov skipped due to Gitea incompatibility).
This commit is contained in:
@@ -147,9 +147,28 @@ The functional test suite uses [stabber](https://git.jabber.space/devs/stabber)
|
||||
Functional tests require stabber to be installed. Once installed, tests run as part of `make check`:
|
||||
|
||||
```bash
|
||||
make check
|
||||
make check # Run all tests (unit + functional)
|
||||
make check-functional-parallel # Run functional tests in parallel (~3x faster)
|
||||
./tests/functionaltests/functionaltests # Run all functional tests sequentially
|
||||
./tests/functionaltests/functionaltests 1 # Run specific group (1-4)
|
||||
```
|
||||
|
||||
#### Test groups
|
||||
|
||||
Tests are organized into 4 groups for parallel execution:
|
||||
|
||||
| Group | Description |
|
||||
|-------|-------------|
|
||||
| 1 | Connect, Ping, Rooms, Software |
|
||||
| 2 | Message, Receipts, Roster, Chat Session |
|
||||
| 3 | Presence, Disconnect |
|
||||
| 4 | MUC, Carbons |
|
||||
|
||||
To add a new group:
|
||||
1. Define the test array in `functionaltests.c`
|
||||
2. Add entry to `groups[]` array
|
||||
3. Update `FUNC_TEST_GROUPS` in `Makefile.am`
|
||||
|
||||
#### Writing functional tests
|
||||
|
||||
Use content-based stubbing with stabber:
|
||||
@@ -168,4 +187,5 @@ Guidelines:
|
||||
2. Use `stbbr_send(xml)` for presence, message, and other push-style stanzas.
|
||||
3. Keep assertions tolerant of ordering when possible; use `prof_output_regex()` for flexible matching.
|
||||
4. If timing issues appear, use `prof_timeout()` around critical expectations and reset afterwards.
|
||||
5. When adding new tests, place them in the appropriate group based on functionality.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user