Skip to content

test: test-all.sh fails 12/104 files on master and stops at the first one; none of them run in CI #174

Description

@dborup

Summary

test-all.sh is the documented way to run the unit tests (AGENTS.md, npm test), but on master 12 of its 104 files fail. The script uses set -e, so it stops at the first failure, which is test-frontend-helpers.js on line 18, and the remaining ~86 files never run in a normal invocation. None of the 12 failing files runs in CI (deploy.yml does not call test-all.sh and does not list these files), so nothing catches them.

Every agent works around this by running files one at a time and comparing against master. That is slow, and it hides real regressions behind "known baseline failures".

Found during #170 (PR #173). The list below was reproduced independently on master.

Failing files on master 84c637ea

Each file was run on its own from a git archive export of master, with Node v26 locally (CI uses Node 22). Each run had a 120 s limit.

File First failure
test-frontend-helpers.js the two known favStar failures (705 passed / 2 failed)
test-channel-psk-ux.js user-added rows use a distinct unlocked icon (🔓) from server-encrypted (🔒)
test-analytics-channels-integration.js channels.js sidebar links to #/analytics with "Channel Analytics" text
test-observers-headings.js expected headings present and ordered
test-issue-1648-m3-emoji-scan.js channels.js has 2 emoji/misc-icon hits
test-issue-1648-m6-final-sweep.js 5 emoji-as-icon violations
test-issue-1648-m6-lint-self.js "repo MUST be clean before anti-tautology probe". Possibly an artefact of running outside a git checkout; verify in a real worktree.
test-issue-1438-customizer-mcrole.js --mc-role-companion does not reflect the active preset (got empty)
test-issue-1446-cb-preset-cascade.js precondition: deut active → --mc-role-repeater = #FE6100 (got empty)
test-issue-1470-node-tile-helper.js getActiveTileProvider in dark mode: provider url voyager, got undefined
test-issue-1485-live-anim-z.js animLayer hosts ≥3 .addTo() animation shapes (got 2)
test-naive-banner-tone.js TypeError: document.addEventListener is not a function (sandbox stub missing)

Some of these were already reported as baseline in other PRs: favStar, channel-psk-ux, analytics-channels-integration, 1648-m3. test-live-anims.js, which is not in test-all.sh, fails too, for the same reason as 1485.

Likely causes (to verify per file)

  • Stale source-text assertions. Fork changes to the UI (for example the Phosphor icon migration, channel sidebar changes and live animation refactors) were made without updating tests that grep the source code.
  • Incomplete vm or DOM stubs for code that now uses newer browser APIs (tbody.contains, document.addEventListener).
  • Customizer/preset tests that depend on CSS variables the test sandbox never sets.

Proposed fix

For each file, pick one of these and record the reason in the PR:

  1. Fix the test. Update the expectation or stub when the behaviour change was intentional. Show that the test still catches a mutant of the behaviour it guards.
  2. Fix the code. Do this when the test found a real regression, and add it to the PR description as a bug.
  3. Delete the test. Only when it is redundant, and name the test that covers the same thing.

Then:

  • Make test-all.sh pass end-to-end on master.
  • Add a CI step that runs test-all.sh, or register the missing files in the JS unit step, so this cannot drift again. Fork guards stay unchanged: 9 × github.repository == 'Kpa-clawbot/CoreScope'.
  • Consider printing a summary from test-all.sh instead of aborting on the first failure, while still exiting non-zero.

Splitting the work into a few PRs is fine, for example one for the 1648 icon tests, one for customizer/preset and one for the rest.

Acceptance criteria

  • sh test-all.sh exits 0 on master after the fix(es).
  • test-all.sh (or the equivalent file list) runs in CI.
  • Every kept test that was changed has a mutant that turns it red.
  • No new npm dependencies.

Relates to #170, #173.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions