Skip to content

feat(ci): report run stats to the tcache - #185

Open
OlufemiAdeOlusile wants to merge 1 commit into
mainfrom
feat/report-stats-to-tcache
Open

OlufemiAdeOlusile wants to merge 1 commit into
mainfrom
feat/report-stats-to-tcache

Conversation

@OlufemiAdeOlusile

@OlufemiAdeOlusile OlufemiAdeOlusile commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Nothing in this repo tells the testing-results-cache that a sync run happened, so the testing dashboard that reads the cache cannot count sync runs or sync hours.

The change follows cardano-node-tests: a runner script, sync_tests/scripts/run_sync.sh, takes the same arguments as pytest, runs it, then reports the run to the cache's /stats route and exits with pytest's code. Both workflows call the runner in place of pytest, and a developer runs it the same way on a laptop, so CI and local runs are reported alike, with origin set from the runner and a local run id when there is none. The report carries the counts from pytest's JUnit file and the sync time, versions and machine size from the results JSON, and names the run sync-node-<network> or sync-dbsync-<network> from the options given. It is off until ENABLE_TCACHE_STATS=true, TCACHE_BASIC_AUTH and TCACHE_URL are set. It never changes the run's exit code, and the job summary shows whether it uploaded, was disabled, or failed. A 200 with an empty body, which a proxy returns for a path it does not route, is treated as a failure.

Tested by running the real runner with real pytest and the real conftest against a local cache running the /stats branch (testing-results-cache PR #25): a CI-style run and a local db-sync run from the mainnet 11.1.0 results file were stored with the right name, origin, sync time and exit code. Seventeen framework tests compute their expectations by hand, and eleven mutants each turned one test red. make lint is green.

To turn it on once the cache is deployed with the /stats route: add the two secrets and set ENABLE_TCACHE_STATS to true. A GitHub re-run keeps the same run id, so it replaces that run's row.

After each sync run, a stats document built from the pytest JUnit file
and the results JSON (counts, sync time, versions, machine size) is
PUT to the testing-results-cache /stats route, the same way
cardano-node-tests does. The report runs from a new runner script,
run_sync.sh, which wraps pytest and takes the same arguments, so CI
and a laptop report the same way. Both workflows now call the runner
in place of pytest.

The report is off until ENABLE_TCACHE_STATS and the TCACHE_BASIC_AUTH
and TCACHE_URL variables are set, and it never changes pytest's exit
code. An empty 200 from a proxy with no /stats route is reported as a
failure, not taken as success.
@OlufemiAdeOlusile
OlufemiAdeOlusile force-pushed the feat/report-stats-to-tcache branch from 7cc5506 to 7759dd1 Compare November 5, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant