The suite's Husky pre-commit hook runs npm run format:check, npm run lint
and npm run typecheck over the whole bigbluebutton-tests/playwright
directory. On v4.0.x-develop all three failed (20 files not formatted,
195 ESLint errors, one type error), so nobody with node_modules
installed could commit there without bypassing the hook. No workflow ran
these checks on the directory (ts-code-validation and
ts-code-compilation cover bigbluebutton-html5 only), which is how the
errors piled up unnoticed.
The fix is mechanical: prettier --write over the directory, then eslint
--fix, which sorted the imports of two files. What remained (22 errors)
was fixed by hand without changing what any test does: an unused import
removed, five unused catch bindings dropped (catch {}), a nested ternary
split into two statements with the same values, two promise executors
that returned setTimeout's id given a block body, two over-long trailing
comments moved above their lines, and ten explicit `any` in browser-side
code (window.editor, GraphQL rows) annotated with the same
eslint-disable-next-line comment the suite already uses.
One rule changed: max-len now ignores template literals, as it already
ignored strings. Prettier cannot wrap them, and the one it flagged is an
assertion message that interpolates a value; splitting it into a
concatenation only to satisfy the limit would make it harder to find in
the code.
The type error was in exportedAnnotationsOverlap.ts: the step that opens
the public chat when it is closed clicked e.userListToggleBtn, a
selector the suite does not have (the 4.0 client has no user-list
toggle; the chat opens from the sidebar navigation), and then
e.chatButton, which matches the public/private switch inside the chat
panel and so cannot open a closed panel. The step now clicks the
messages sidebar button, as the other tests do. The step is not reached
on a default server, where the moderator's chat is already open.
The change was checked to be behaviour-neutral. Comparing the syntax
trees of every .ts, .js and .cjs file before and after, ignoring
formatting, comments, quotes, trailing commas and redundant parentheses,
160 of the 166 files are unchanged and the other six differ exactly by
the changes listed above. The whole suite lists the same 679 tests with
the same titles, tags, annotations and expected status before and
after, and the Chromium @ci selection the same 660.
A new workflow, playwright-code-validation, runs the same three checks
on pull requests that touch the directory, with the same trigger and
checkout steps as ts-code-validation. The README's pre-commit section
now names the three checks and the workflow.
What does this PR do?
Makes
bigbluebutton-tests/playwrightpass its own three checks (npm run format:check,npm run lint,npm run typecheck) and adds a workflow that runs them on pull requests touching the directory.The suite's Husky pre-commit hook runs those three checks over the whole directory. On
v4.0.x-developall three fail (20 files not formatted, 195 ESLint errors, one type error), so nobody withnode_modulesinstalled can commit there without bypassing the hook. No workflow runs the checks on this directory (ts-code-validationandts-code-compilationcoverbigbluebutton-html5only), which is how the errors piled up unnoticed.The fix is mechanical:
prettier --writeover the directory, theneslint --fix, which sorted the imports of two files. The 22 errors that remained were fixed by hand without changing what any test does: an unused import removed, five unused catch bindings dropped (catch {}), a nested ternary split into two statements with the same values, two promise executors that returnedsetTimeout's id given a block body, two over-long trailing comments moved above their lines, and ten explicitanyin browser-side code (window.editor, GraphQL rows) annotated with the sameeslint-disable-next-linecomment the suite already uses.One rule changed:
max-lennow ignores template literals, as it already ignored strings. Prettier cannot wrap them, and the one it flagged is an assertion message that interpolates a value; splitting it into a concatenation only to satisfy the limit would make it harder to find in the code.The type error was in
exportedAnnotationsOverlap.ts: the step that opens the public chat when it is closed clickede.userListToggleBtn, a selector the suite does not have (the 4.0 client has no user-list toggle; the chat opens from the sidebar navigation), and thene.chatButton, which matches the public/private switch inside the chat panel and so cannot open a closed panel. The step now clicks the messages sidebar button (e.messagesSidebarButton), as the other tests do. On a default server the moderator's chat is already open (public.chat.startClosed: false), so the step is not reached.CI: the new
playwright-code-validation.ymlruns the three checks on pull requests that touch the directory, with the same trigger and checkout steps asts-code-validation. The README's pre-commit section now names the three checks and the workflow.Why
A pre-commit hook that always fails gets bypassed, and lint errors that nobody sees accumulate. With the directory clean and the checks in CI, the next unformatted file or unused import shows up as a red check on the pull request that adds it, not 200 problems later.
How to test
Testing
v4.0.x-develop(ac97a8b)npm run format:check(Prettier 3.6.2)npm run lint(ESLint 8.57.1)npm run typecheck(TypeScript 5.9.3)npx playwright test --listbefore and after, compared without thefile:line:colprefix (line numbers move with the formatting): PASS, the same 690 tests. The JSON list, compared on titles, tags, annotations and expected status: PASS, identical. The Chromium@ciselection (--project=chromium --grep @ci): PASS, the same 671 tests..ts,.jsand.cjsfile in the directory, compared ignoring formatting, comments, quotes, trailing commas and redundant parentheses: 164 of the 170 files unchanged; the other six differ exactly by the changes listed above.actionlint1.7.12 on the new workflow: PASS, no findings. Its first real run is this PR.