Repository navigation
feat(stats): report testrun stats to the tcache - #3717
Open
OlufemiAdeOlusile wants to merge 1 commit into
Open
OlufemiAdeOlusile wants to merge 1 commit into
OlufemiAdeOlusile wants to merge 1 commit into
Conversation
OlufemiAdeOlusile
requested review from
mkoura and
saratomaz
as code owners
September 29, 2026 04:53
OlufemiAdeOlusile
force-pushed
the
add-stats-upload
branch
from
October 12, 2026 03:13
a0e72cd to
f89bf8b
Compare
OlufemiAdeOlusile
force-pushed
the
add-stats-upload
branch
from
October 19, 2026 02:08
66a9efb to
724f25c
Compare
The tcache has a /stats endpoint, but nothing calls it, so no test run records how many tests it ran or how long it took. scripts/stats_json.py builds a small JSON document from the Allure results: the counts, grouped by historyId the same way as count_test_results.py, plus the run identity, the wall-clock duration, the node and CLI versions and the CLI coverage numbers. runner/report_stats.sh uploads it with one PUT. regression.sh sends one row per run and node_upgrade_pytest.sh one row per step. A run is identified by project, testrun name, run id, step and origin. Each workflow's runner/env_* file names its run through TCACHE_TESTRUN_NAME; a typed CI_TESTRUN_NAME wins and marks the run as a release. The run id is GITHUB_RUN_ID on CI. A local upgrade run gets one id from node_upgrade.sh, exported as TCACHE_RUN_ID, so its steps are stored as one run. A run under MARKEXPR or DESELECT_FROM_FILE is marked filtered. The upload is off unless ENABLE_TCACHE_STATS is truthy. It reuses TCACHE_BASIC_AUTH and TCACHE_URL, every call is "|| :" and curl has a timeout, so it can neither change the exit code nor hold up a run. The reusable workflows pass the tcache secrets and the flag to the test step; upgrade_reusable.yaml did not declare the secrets at all. The nightly, nightly-cli, nightly-dbsync and regression-leios workflows still do not pass them (#3624).
OlufemiAdeOlusile
force-pushed
the
add-stats-upload
branch
from
November 12, 2026 09:10
724f25c to
c6e42ad
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tcache has a
/statsendpoint (mkoura/testing-results-cache#25), but nothing calls it, so no test run records its counts or its duration.This adds the client half.
scripts/stats_json.pybuilds a small JSON document from the Allure results: the counts, grouped byhistoryIdlikecount_test_results.py, plus the run identity, duration, versions and CLI coverage.runner/report_stats.shuploads it with onePUT: one row per regression run, one row per upgrade step under one run id. Eachrunner/env_*file names its run, a typedCI_TESTRUN_NAMEwins and marks a release, and the run id isGITHUB_RUN_ID. The upload is off unlessENABLE_TCACHE_STATSis truthy and reusesTCACHE_BASIC_AUTHandTCACHE_URL. Every call is|| :with a curl timeout, so it cannot change the exit code or hold up a run. The reusable workflows now pass the secrets to the test step;upgrade_reusable.yamldid not declare them at all.Tested on a laptop against a real tcache under gunicorn behind Caddy: a smoke regression run of 79 tests and a full three-step upgrade run of 5,450 tests from 11.1.3 to 11.2.0, each stored and read back from
/stats/runs, the upgrade as one run with three steps. A broken submit count turned the check red. With the flag off, the secrets missing, the tcache down, a wrong password, a 404, a 500 or no answer, the caller keeps its exit code. No unit tests, the same ascount_test_results.py.Safe to merge before the server side, as the upload is off by default. Set the
ENABLE_TCACHE_STATSrepository variable once/statsis deployed. The nightly and leios workflows still do not pass the secrets (#3624).