Skip to content

test(console): consolidate the console browser tests added since #2903 - #2947

Merged
freeqaz merged 3 commits into
mainfrom
test-deslop-1019b
Oct 19, 2026
Merged

freeqaz merged 3 commits into
mainfrom
test-deslop-1019b

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Since #2903 about 25 PRs added console browser tests. Most new cases booted their own console fixture (about 0.3 s each before the page loads), several files carried their own copy of the same helper (a status line's class/tone/role, the browser invalid event counter, hand-written request holds), and the long-name test looked up each of ~90 names by accessible name, twice. console-agents-list-return also launched a new Chromium for every page. The duration rows for the grown files were stale, and console-form-fields-2 and console-agent-name-runs had none (flake-sweep-1019b).

Change

Test-only. No assertion is removed or loosened; every former test is still a named test or subtest.

  • console-status-block: the 26 tests are 6 top-level tests, one console each (Share Agent refusals, notices and the sign-in alert, authentication source outcomes, repository access refusals, Configuration save outcomes, Run diagnostics). Each former test is a t.test subtest with its own Agent (and its own Namespace where it had one) and its own browser context. The binding-removal case gets a Namespace of its own, because it really shares and leaves a Role that a later share would reuse. Hand-written holds use the shared holdRequests.
  • console-form-fields / -2, console-namespace-not-ready: cases with the same setup share one console (Create Agent form fields; Plugin selections JSON; the gated Create Agent form). Each case keeps its own Namespace or Agent.
  • console-agents-list-return: one Chromium for the file (fileBrowser, as the other console files do). The long-name test measures every listed name in one evaluate per width and asserts each case as before, plus that each name is listed exactly once.
  • Helper module (console-agents-browser-helpers.mjs): statusTone(locator, { text }), hasFocus(locator) and countInvalidEvents(page). They replace three statusTone copies, five inline copies and two countInvalidEvents copies. console-namespace-not-ready's warning check now compares the exact class (was classList.contains).
  • file-durations.json: new rows for console-form-fields-2 and console-agent-name-runs; refreshed rows for the files that grew. Method below.

Verification

Mutants, before (main def1817) and after (this head). 120 mutants listed by the lanes that added these tests since #2903 (from their PR bodies and lane logs; "derived" rows rebuild a PR's "fails on main" claim as a source mutant), plus 10 of my own aimed at the cases this PR regroups. Each mutant was run against the test files that should kill it, at 2 CPUs. The console-status-block mutants were run again on the final head after the removal-Namespace fix.

Source Mutants Killed on main Killed on this head
ux-fixes-125 (#2906, #2908) 13 13 13
ux-fixes-126 (#2916, #2917) 22 22 22
ux-fixes-127 (#2918) 4 4 4
ux-fixes-128 (#2923, #2924) 4 4 4
ux-fixes-129 (#2926, #2930, #2935) 22 22 22
ux-fixes-130 (#2937, #2943) 8 7 7
ux-c3 (#2907, #2912) 5 5 5
test-gaps-127 (#2927, #2928, #2931) 41 40 40
flake-1986 (#2915) 1 1 1
Own (status-block regrouping, form fields) 10 10 10
Total 130 128 128

The kill sets are identical, mutant by mutant. The same two survive on both sides: detail_stop_notice_warning (the Stop notice's tone, console-agent-detail, which this PR changes only by importing statusTone) and ns_old_form_keeps_polling (a derived #2937 row in console-namespace-not-ready). Neither is a regression here; both are recorded as board findings. One mutant a lane reported as surviving (ln_a4_lookbehind_dropped, #2935) is killed on both sides.

Pins at 2 CPUs (taskset), 20 runs each on this branch:

File Result
console-status-block 20/20 (and 20/20 again after the removal-Namespace fix)
console-agents-list-return 20/20
console-form-fields, console-form-fields-2, console-namespace-not-ready 20/20 each
console-agent-channels, console-agent-plugin-approvers 20/20 each
console-agent-repositories, console-agents, console-agent-detail 20/20 each
console-agent-detail-2 19/20, then 20/20 on a second pin (39/40). The one failure is in a test this PR does not touch ("a Workspace reread keeps the caret and scroll of a focused, unedited editor": SOUL.md did not scroll, load 28.8); main pinned 20/20 beside it. Recorded as a low flake finding.

Wall time, local, 2 CPUs. Five paired runs, main and this branch side by side at the same load:

File main branch ratio
console-status-block 31.2 s 21.5 s 0.69
console-agents-list-return 43.8 s 37.1 s 0.85
console-form-fields 9.9 s 9.4 s 0.94
console-form-fields-2 13.0 s 11.0 s 0.85
console-namespace-not-ready 11.8 s 12.1 s 1.02 (noise)
Lane (run-tests.mjs, 2 CPUs, run side by side) main branch
checks-browser 445.9 s 440.6 s
checks-browser-2 503.2 s 496.2 s

The lanes run 8 files at a time, so the per-file savings show up as about 1% of lane wall time, within noise. Both checks-browser runs fail only docs-compute-matrix locally (the docs preview cannot load github-slugger in a worktree), on main as on the branch.

Duration rows. Runners have been slower since about 08:45Z (15 to 90% per run). Each main run's time for a file is divided by its lane's slowdown factor (median over the lane's files that no PR changed since #2903 of time / row; e.g. 1.86 for checks-browser-2 on def1817), and the row is the median over the main runs since the file last changed. Files this PR changes are then scaled by the local ratio above.

File Old row Scaled CI median (runs) New row
console-status-block 7.2 s 17.7 s (8) 12.2 s (x0.687)
console-agents-list-return 29.2 s 42.4 s (7) 35.9 s (x0.847)
console-button-hierarchy 20.6 s 23.6 s (22) 23.6 s
console-drafts-kept 34.0 s 34.7 s (24) 34.7 s
console-form-fields 8.4 s 10.3 s (18) 9.7 s (x0.942)
console-form-fields-2 none 12.8 s (12) 10.9 s (x0.846)
console-namespace-not-ready 9.4 s 12.2 s (6) 12.2 s
console-agent-name-runs none 0.54 s (1, unscaled) 0.5 s

The drafts-kept growth flake-sweep-1019b saw (34 to 42 s) was the runner slowdown, not the file.

Lint and format: eslint (--max-warnings 0) and prettier --check on every touched file pass; node scripts/ci/run-tests.mjs audit reports no issues. No new test file, so no suite mapping changes.

Open PRs: a 3-way git merge-tree of this head with every open PR touching these files (#2922, #906, #2518, #2596, #2258, #878, #115) gives the same conflicted files and hunks as the same merge with main: no new conflict hunk. #2922's new form-field tests use countInvalidEvents, errorPlacement, assertFieldError and assertShownError, which keep their names here.

Internal review: no assertion weakened. Fixed: a prettier line in console-status-block, the removal case's shared-Namespace order dependence, and a comment left without its code in console-agent-repositories.

Risks

  • Subtests share one console per group, so a broken case can leave server state for the next. Every case has its own Agent; the cases that write (the removal share, a Configuration update, repository and authentication PATCHes) touch only their own Agent or Namespace.
  • Contexts stay open until the group's console closes (as list-return's width loop already did), so a failing subtest's screenshot is taken when its group ends.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@freeqaz
freeqaz requested a review from a team as a code owner October 19, 2026 15:15
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares console browser fixtures and assertion helpers, batches long-name measurements, and refreshes CI scheduling estimates.

Example: Run the console status-block browser suite.

  • Before: The 26 cases repeatedly start separate console fixtures.
  • After: Six groups share fixtures while preserving named cases and separate browser contexts.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, scoped test maintenance supported by native browser validation and source review, with no identified defect; no tests were run during this read-only review.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored test-only change is outside the ordinary live-behavior proof gate; reported repeated browser runs and native CI support validation, while the inspected sharing screenshots are unrelated to the changed test behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated console setup and duplicated assertions increase regression-suite maintenance cost.
Reason: The maintainer-authored direction reduces duplication while retaining distinct regression scenarios and existing application boundaries.

Merge readiness

✅ Ready for maintainer review

Keep open for normal maintainer handling: this PR provides useful test consolidation, and the reviewed diff has no actionable correctness findings.

Priority: P3
Reviewed head: c4fa5e07fda7c281f95364d315e1931a95991777

Before merge

None.

Findings

None.

Agent review details

How this fits together

Console browser suites exercise served UI and controller routes through an in-memory application fixture; shared helpers collect observations, and duration estimates order CI test files.

flowchart LR
  A[CI duration estimates] --> B[Test runner]
  B --> C[Browser test cases]
  D[Shared browser helpers] --> C
  C --> E[Console application fixture]
  E --> F[Rendered console]
  F --> G[Behavior assertions]
Loading

Technical review

Best possible solution:

Land the focused consolidation through the ordinary protected merge process once required CI passes.

Do we have a high-confidence way to reproduce the issue?

Source inspection confirms repeated fixture setup and duplicated observation helpers; this PR does not report a new product bug.

Is this the best way to solve the issue?

The change reuses established browser and fixture owners, preserves the changed scenarios' behavioral assertions, and keeps scheduling changes confined to measured estimates.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against def181770d66.

Provenance checked

  • Shared browser lifecycle keeps the original intent (3d9ad33: Reuse Chromium while isolating cookies, storage, routes, and viewport in separate contexts.)
  • Status and refusal assertions keeps the original intent (acc8257: Protect danger announcements, focused refusals, progress resets, and retained feedback tones.)
  • Form validation scenarios keeps the original intent (5963327: Verify persistent field errors and preserve reader focus during asynchronous saves.)
  • Namespace readiness scenarios keeps the original intent (40676a7: Verify readiness recovery preserves the draft and does not accumulate polling loops.)
  • Long-name browser measurements keeps the original intent (61ec422: Compare name classification with actual Chromium line-breaking behavior.)
  • CI scheduling estimates keeps the original intent (e834adc: Start longer shared files earlier using measured durations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit 3d9ad33 adds tests/browser/console-agents-browser-helpers.mjs:71 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d9ad33abd56; files: tests/browser/console-agents-browser-helpers.mjs)
  • stevenlee-oai: Raw commit ab70527 adds tests/browser/console-agent-plugin-approvers.test.mjs:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ab70527a7020; files: tests/browser/console-agent-plugin-approvers.test.mjs)

Review metrics

Metric Value Why it matters
Change footprint Application +0/-0; browser tests and helpers +1261/-1348; CI data +9/-7 Net deletion reflects consolidated setup and observations without expanding production machinery.

Labels

Label changes:

  • add P3: This is test maintenance and scheduling-estimate cleanup without changed product behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is test maintenance and scheduling-estimate cleanup without changed product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 11:29 AM ET / 15:29 UTC.

@freeqaz
freeqaz merged commit 22283f6 into main Oct 19, 2026
57 of 58 checks passed
@freeqaz
freeqaz deleted the test-deslop-1019b branch October 19, 2026 15:47

@freeqaz-openai freeqaz-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Free's clanker here. One small coverage loss in the batched Agents-list measurement; keep the batch, but select links rather than all <a> elements.

I ran the exact measurement and assertions from c4fa5e07 in sandboxed Chromium with two synthetic rows. With both links intact, the PR and a role-based batch passed. Removing only the first link’s href (same name, class, and geometry; last link still valid), the old exact link-role selector found zero matches, but the PR’s full measurement still passed. A batch using table.getByRole("link").evaluateAll(links => …) correctly failed “is listed once.” This tests what the regression would catch; I’m not claiming the product currently emits a broken link.

The small change is to measure links in that one call and use link.closest("table").after(box) while measuring. It preserves the link-role coverage without restoring one browser round trip per name. Separately, our source comparison found all 187 prior named test declarations/templates retained in their files and the new grouping parents; that’s a discovery check, not a claim we reran the whole matrix. No CI or bot rerun requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants