Repository navigation
test(harness): add a release gate that gives one verdict per commit - #937
Conversation
…ommit Runs the suites a manifest lists, keeps a log per suite and writes report.json and report.html with one verdict: pass, fail or incomplete. A suite that did not run never counts as a pass. The release profile refuses a tree with uncommitted changes. --tree judges another checkout, such as a worktree of a release tag. The runner follows the one in Cacti core so the two are recognisably one design; its tiers are the ones a plugin release needs. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…crawl package.py compares the INFO version with the CHANGELOG top entry and lists the development files a release archive would hold. i18n.py compares the committed template with a regenerated one, checks that each translation keeps its source string's format specifiers, and lists every format string to run through sprintf. live.py logs in to a running Cacti, crawls the pages the plugin registers, checks that its source's tables, hooks and realms are in the database, and reads cacti.log for errors. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
… containers Pest runs on every PHP in the plugin's CI matrix with the locked harness and Cacti 1.2.x that CI uses; php -l runs on the oldest and newest. The template is regenerated with the xgettext command from build_gettext.sh, and every format string runs through sprintf on PHP 8, where a trailing or unpaired percent sign throws. Nothing is installed on the machine running the gate. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…1.2.x Starts MariaDB and Cacti in containers named tholdgate-*, with passwords generated into files at run time. Installs the plugin from the tree and checks what it registers; upgrades a database installed from the latest earlier release tag and compares the plugin's schema with a fresh install's; crawls every plugin page and tab and draws a graph with a percentage threshold's HRULE colour. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Thirteen suites in seven tiers: static, unit, i18n, integration, upgrade, ui and package. A test checks that every tier has a blocking suite, so a release verdict can pass, and that every script the manifest names exists. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
workflow_dispatch only, with read-only permissions, pinned actions and no secrets. Kept in its own commit so it can be dropped. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…ler before an upgrade The PHP 8.6 image has no mbstring, which Pest's output needs. The upgrade suite replaced plugin files while the poller's background processes were loading them, which logged errors no administrator could reproduce; it now waits for them and turns off the installer's network discovery. A tag from before the plugin had a CI workflow is judged on today's PHP matrix. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
… unit suite The plugin's file permission test skips itself as root, so the container user hid it. A tag with no phpunit.xml now fails with a message instead of a Pest usage error. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
- discard the sprintf result explicitly; only whether it throws matters - default the image to an ordinary user and start only the live web container as root - use [[ ]] in the bash suites - keep the harness cache and results out of php -l, and report every file that fails to parse instead of stopping at the first - stop macOS tar adding ._ metadata files to the plugin copy - make the work directory that holds the generated passwords private - document that the log check is deliberately broad and that missing realm files are a note Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Judging an older release (--tree <worktree of v1.8.1>) listed every v* tag, so the upgrade suite could start from a newer release and test a downgrade. List only the tags merged into HEAD. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
TheWitness
left a comment
There was a problem hiding this comment.
Reviewed. The workflow is workflow_dispatch only, with contents: read, no secrets and no pull_request_target; inputs reach run: only through quoted env:. All three actions are pinned by SHA at their latest releases (checkout v7.0.1, setup-python v7.1.0, upload-artifact v7.0.2). gate.py never uses shell=True. A suite that times out, fails to start or doesn't run never counts as a pass, and any old report is cleared before a run. One fix pushed as b647e38: from-tag listed every v* tag, so judging an older release (--tree of v1.8.1) would have 'upgraded' from v1.8.2. It now uses git tag --merged HEAD. The 65 harness tests pass, and the Pest suite passes merged with current develop.
|
Reviewed: no blocking issues apart from one fix, which I pushed as b647e38. I can't merge it from here: the repo rules need an approval from someone other than the last pusher (me), and the merge adds |



Problem
There is no single check that a plugin commit is ready to release. Defects have reached tags that only an install, an upgrade, a page crawl or a translation run on PHP 8 would have shown.
Fix
Adds a release gate in
tests/harness/: a runner (gate.py), a manifest of 13 suites in seven tiers, the scripts they run, and a manual workflow in its own commit so it can be dropped. No production code changes; the only existing file touched is.gitignore. The gate follows the design proposed for Cacti core and leaves out core-only tiers and checks.Verification
python3 -m unittest discover -s tests/toolspasses (65 tests).developand onv1.8.2. Both fail, for these reasons:develop:upgrade-from-release(Upgrade from 1.8.2 logs Duplicate column name 'attempt_count' on notification_queue #933 and A fresh install and an upgrade give different defaults on five columns #934) andpackage-version(the CHANGELOG top entry is stilldevelop, which is expected before a release is cut).v1.8.2: also the i18n suites (template and catalogs out of date,%%%strings) andpages-crawl(a graph with a percentage HRULE throwsValueError); the tag has no unit suite.Not covered: JavaScript errors, nginx or Apache (the web container is PHP's built-in server), SNMP devices, alert delivery, remote pollers, non-admin users, upgrades from tags older than the latest one. The workflow file has not been run on GitHub.
Fixes #936