Files
86a062dd09 ci: enforce cross-platform quality gates and connector coverage (#618)
## Summary

Consolidates the connector/build work from #613 and the broader
test-infrastructure work extracted from #597 into one review:

- discover MariaDB Connector/C first while retaining MySQL and
Percona-compatible support
- test MariaDB and MySQL Connector/C with strict GCC and Clang builds on
Ubuntu 24.04
- add a real macOS 15 build and unit-test lane with portable Autotools
platform detection
- run unit tests under ASan/UBSan and ThreadSanitizer
- enforce the measured 7% global coverage baseline and 70% changed-line
coverage
- add libFuzzer coverage for output parsing alongside the existing
hostname parser
- exercise the SNMPv3 integration suite against MariaDB and MySQL 8.4
- add cppcheck, shellcheck, DCO verification, CODEOWNERS, distcheck, and
Linux-capability checks while retaining the repository-managed default
CodeQL setup
- expose a stable `CI / required` aggregate check for branch protection
- pin runners and third-party actions and keep workflow permissions
read-only by default

## Correctness fixes found by the new gates

- reject truncated capability strings and poller-output SQL tuples
instead of publishing partial data
- make `bootstrap` fail closed and select `libtoolize`/`glibtoolize`
portably
- use Autoconf's canonical host for Darwin detection instead of an empty
native-build alias
- remove stale initialization/name-shadow findings and make read-only
interfaces const-correct
- make the ICMP parser test portable across Linux and BSD header names

## Verification

- strict GCC and Clang builds: 4/4 unit targets passed
- ASan/UBSan: 4/4 passed
- ThreadSanitizer: 4/4 passed
- macOS Clang/Homebrew build: 4/4 passed
- MariaDB integration: passed
- MySQL 8.4 integration: passed
- both libFuzzer targets: passed sustained local runs
- coverage: 7.2% global and 84% on changed lines
- cppcheck, shellcheck, actionlint, DCO verification, and `git diff
--check`: passed locally

## Post-merge repository settings

After these workflows exist on `develop`, an administrator should
require `CI / required`, Fuzz, Integration, Rocky Linux, and the
repository-managed CodeQL/code-scanning result in the active ruleset;
enable code-owner approval; and require the branch to be current (or use
a merge queue). Enabling those settings before this PR merges would
create required checks that the base branch cannot yet emit.

Consolidates and supersedes #613. Closes #612.

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: TheWitness <thewitness@cacti.net>
Signed-off-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
2026-09-24 05:52:56 -04:00

1.9 KiB

Spine test harness

make check runs the cmocka unit tests. The Docker-backed integration fixture uses a real Net-SNMP agent and MariaDB or MySQL to exercise the complete poll and persistence path.

Run the standard end-to-end test with:

SPINE_TEST_DATABASE=mariadb tests/snmpv3/scripts/run-integration.sh

Run the concurrency contract with:

SPINE_TEST_HOSTS=24 \
SPINE_TEST_THREAD_COUNTS="1 4 12" \
SPINE_TEST_REPEATS=1 \
tests/integration/test_concurrency.sh

Exercise timeout and recovery behavior with real UDP packet loss:

tests/integration/test_network_faults.sh

The concurrency test creates an isolated Compose project, clones independent SNMPv3 host records, sweeps worker counts, and verifies exact output and host accounting after every run. It is intentionally transport-neutral so it can also test a future libuv engine and reactor-count matrix without changing its assertions. Fixture services communicate only on their project-local Compose network, so independent test projects can run without competing for host ports. The fault test uses tc netem inside the test-only SNMP agent container to drop every response, verifies bounded completion without stale output, removes the fault, and verifies the next poll recovers.

Useful controls:

  • SPINE_TEST_TIMEOUT_SECONDS: per-Spine-run timeout (default 120).
  • SPINE_TEST_ARTIFACT_DIR: destination for logs and TAP results.
  • SPINE_TEST_KEEP_ENV_ON_FAILURE=1: preserve containers after a failure.
  • SPINE_TEST_PROJECT: explicit Compose project name for reproducibility.
  • SPINE_TEST_EXTRA_ARGS: additional whitespace-separated Spine arguments. This provides the hook for future --snmp-engine and reactor-count sweeps; arguments are split but never evaluated as shell code.

Keep CI workloads bounded. Larger host counts and repeat counts belong in a scheduled soak workflow rather than the pull-request critical path.