Skip to content

perf(test): add --timings to run-plugin-tests.sh, a gate timer and the wall-clock baseline doc - #11730

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10200-41245614213-1
Oct 31, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10200-41245614213-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #10200

Summary

Opened by the work-resolve-issue lane. The run's own summary:

scripts/run-plugin-tests.sh gains --timings FILE, which writes one TSV row per suite (path, the wall seconds its TIME line prints, exit code), and positional SUITE arguments, so run-plugin-tests.sh --timings <f> <suite> runs and times one suite; without the flag and arguments nothing changes. A new scripts/time-gates.sh times the five gate scripts in their typical single-diff invocation into the same format (milliseconds, since gates can be sub-second), and docs/test-wall-clock-baseline.md documents how to produce each column, names whole-tree run 41211887017 as the Linux CI source, carries a row for each of the five gates and an empty Windows column, and is linked from the header of scripts/affected-tests.sh. Design choices: a separate small timer script rather than a mode on the test runner, because the gates take arguments and suites do not; the timer and its test have no #! line and run through bash, because this lane cannot set an executable bit and CI's check-exec-bit fails a 100644 #! file. The Linux numbers themselves are not filled: the run's job logs need an authenticated read this lane does not have.

Remaining work

  • Fill the Linux CI column of docs/test-wall-clock-baseline.md from the TIME: lines of the seven test-bash job logs of whole-tree run 41211887017 (needs an authenticated gh run view --log --job <id>), and the gate-script Linux column from bash scripts/time-gates.sh --timings <file> on

Not verified

  • The Linux CI column of docs/test-wall-clock-baseline.md has no per-suite rows: run 41211887017's job logs answered 403 to an unauthenticated read, and this lane has no gh credentials. The doc names the run and the gh run view --log --job recipe for the fill.
  • Gate-script Linux times are not filled: the lane may run only its named wrappers, so scripts/time-gates.sh was not executed here.
  • scripts/run-plugin-tests.test.sh and scripts/time-gates.test.sh were not executed (the lane runs no test suite; check-affected ran without --tests); left to the PR's CI test-bash lanes.
  • Done-when 'ci-status is green on the PR head' is a PR CI check; left to the PR's CI.
  • shellcheck and shfmt over the new scripts were not run directly here; check-affected passed its shell checks, and CI's lint-shell runs them in full.
  • Tidy skipped: the change touches scripts/, a listed shared path, and spans two areas (scripts, docs/test-wall-clock-baseline.md) against a cutoff of one.
  • scripts/time-gates.sh and scripts/time-gates.test.sh are in the index as intent-to-add entries: an attempted git-mv-rm rm of them (from an abandoned redesign) recorded them and then failed on a read-only file system. They are kept as intended files of this change.

Fix

  • scripts/run-plugin-tests.sh: --timings FILE (TSV row per suite: path, seconds, exit code; empty value and missing directory rejected), positional repo-relative SUITE arguments joining the --suites-from selection, header and usage updated
  • scripts/run-plugin-tests.test.sh: cases for one-suite --timings row shape, whole-corpus rows in corpus order with a failure's exit code, missing suite argument, missing --timings directory, empty --timings value, and the no-flag run unchanged
  • scripts/time-gates.sh: new gate timer; runs check-purged-em-dashes.sh --check, check-changed-skills.sh <base>, check-changelog-parity.sh --check-bump <base>, check-skill.sh check (skill-quality skills root, base ref <base>, markdownlint skipped) and check-open-questions.sh --ledger
  • scripts/time-gates.test.sh: new stub-gate self-test of row order and shape, each gate's arguments, a failing gate's exit code recorded, and usage errors
  • scripts/affected-tests.sh: header comment links docs/test-wall-clock-baseline.md
  • docs/test-wall-clock-baseline.md: new baseline doc: how to produce each column, gate-script table with the five gates, per-suite table naming run 41211887017 as the Linux CI source, Windows column empty for slice 2

Verification

The runner ran each check from the base copy against c13d284:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 49 changelog fragment(s) under .changes/ are valid (run before and after the review fixes)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 11 passed, 4 skipped (ruff, typos not installed, validate-plugins, changed-skills) over 6 changed files (run three times, last after the review fixes)
  • cant-fail-scan --file scripts/run-plugin-tests.test.sh --check: PASS, no gating findings
  • cant-fail-scan --file scripts/time-gates.test.sh --check: PASS, no gating findings
  • fresh-context review subagent over the whole diff: no high or medium findings; four low findings fixed (empty --timings accepted, clock read through a forking command substitution, check-skill missing CHECK_SKILL_BASE_REF, doc wording implying measured numbers), one left as designed (suite arguments
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/actions/runs/41211887017: pr-require-checks, workflow_dispatch on main at fd862a4, completed success, created 2026-10-31T14:49:06Z
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/actions/runs/41211887017/jobs?per_page=100: 23 jobs, test-bash (0) through (6) all success
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/actions/jobs/124568506581/logs: HTTP 403 without authentication, so the TIME lines could not be read
  • read https: //cli.github.com/manual/gh_run_view: --log views the full log for a run or specific job; -j/--job views a specific job ID; example gh run view --log --job 456789
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41245614213

Left out: the items under Not verified.

Related

#10200

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed c13d284ebe3fea674f8db003af354e8fbe7d92b3: 0 finding(s), 0 as inline comments.

No security findings.

I read the whole diff (6 files) and the PR context. The change is local developer tooling: a --timings FILE flag and positional SUITE arguments for scripts/run-plugin-tests.sh, a new scripts/time-gates.sh with its self-test, and a baseline doc. No changed file matches a trusted path, and no workflow, action, token scope, kill switch, merge hold, plugin manifest or instruction surface is touched.

What I checked:

  • Suite arguments. run-plugin-tests.sh runs a named suite only when it is an existing file, and the operator supplies the arguments on their own command line. The diff adds no CI workflow call that passes untrusted input into them. The change from *) usage to -*) usage still rejects dash-prefixed arguments, so a suite argument cannot be read as a flag.
  • --timings and --base. The path is canonicalized, the directory must already exist, and the file is only truncated or appended with tab-separated rows (suite path, seconds, exit code). time-gates.sh quotes --base and every other value when it passes them to the gates, so there is no shell injection. The env assignments are fixed names, and $base is quoted into CHECK_SKILL_BASE_REF.
  • Temporary files. The ledger goes in a mktemp -d directory that an EXIT trap removes. The gate paths are fixed constants, and TIME_GATES_ROOT is a test-injection variable read from the caller's own environment.
  • Secrets. Nothing here reads or writes tokens or secrets. The doc only points to gh run view --log with an authenticated gh, and it embeds no credentials.
  • PR context. The PR text contains no embedded directives aimed at the reviewer.

Cost: none. The change has no billing surface, and no schedule or lane run is added or changed.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed c13d284ebe3fea674f8db003af354e8fbe7d92b3: 0 finding(s), 0 as inline comments.

No blocking findings on the 6 changed files. I read the whole diff and checked it against the PR context and the surrounding repo code. I ran nothing (no shell here), so the test results the PR body cites are author-claimed and unverified by me.

What I checked

  • scripts/run-plugin-tests.sh --timings and SUITE arguments:
    • Rows come from $log.secs and $log.rc, which the worker writes at lines 185-186 before the summary loop reads them.
    • Rows follow corpus order because the loop walks tests.
    • Named suites join the supplied selection before the shard split, so --suites-from and --shard still compose.
    • Without the flag or arguments the paths are unchanged. -*) usage still rejects unknown flags; only non-dash words are new.
  • scripts/time-gates.sh:
    • CHECK_SKILL_SKILLS_ROOT, CHECK_SKILL_BASE_REF and CHECK_SKILL_SKIP_MARKDOWNLINT are all read by plugins/skill-quality/scripts/check-skill.sh.
    • --check and --check-bump <ref> exist on the gates they are passed to.
    • Millisecond formatting and the SECONDS fallback are correct.
    • The exit code is recorded, not judged.
  • Exec bit: the diff records the two new shebang-less scripts as 100755. check-affected.sh only requires a #! file to be 100755, and does not object to 100755 on a file without one, so this is harmless. The header line "needs no executable bit" is slightly off but not a defect.
  • Markdown: MD024 is set to siblings_only, so the repeated "Shell suites" and "Gate scripts" headings in the baseline doc are allowed.

Not met by this PR (author-disclosed)

  • The deliverable is the baseline numbers, and docs/test-wall-clock-baseline.md has none yet. The gate table's Linux and Windows cells are empty, and the per-suite table is a bare header with no rows.
  • The PR's "Remaining work" and "Not verified" sections say the same. Anyone closing perf(test): add a per-suite timing option and a wall-clock baseline doc with the Linux column #10200 should know the data is still to be filled. There is no closing-issue section in the PR context, so I had no acceptance criteria to quote.

Minor, not counted

  • --timings combined with --list truncates the file and writes nothing.
  • A suite whose worker never reported gets no row. The header comment says "each suite that reported", so this is documented.

Spend: none. The change adds local timing tooling and a doc, with no billed resource or added lane runs.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head c13d284ebe3fea674f8db003af354e8fbe7d92b3.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 632c3b8 Oct 31, 2026
49 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-10200-41245614213-1 branch October 31, 2026 22:58
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 632c3b8e9e8c99faaa55a0a8908f8db10f4f8bb6; later checks count it verified from this comment.

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.

0 participants