Skip to content

Improve webchat-html-tests skill for writing tests and shared grids - #5880

Merged
Eugene (OEvgeny) merged 1 commit into
mainfrom
OEvgeny/dev-html-tests-skill
Oct 17, 2026
Merged

Eugene (OEvgeny) merged 1 commit into
mainfrom
OEvgeny/dev-html-tests-skill

Conversation

@OEvgeny

Copy link
Copy Markdown
Collaborator

Changelog Entry

Not required, development only.

Description

Agents writing and running HTML tests with the webchat-html-tests skill lost time on four things the skill did not cover. They checked whether dist was stale, because nothing says that tests load built files rather than src. They guessed asset URLs: /assets/surface1.jpg returns 404, because /assets/ only serves __tests__/assets/. They had to find out how *.fluent.html variants work. And cleanup-grid-sessions.py deletes every grid session, so on a grid shared by several runs it killed another run's busy session.

This PR documents the first three in the skill references and makes the cleanup script safe for shared grids. Without options, the script still deletes every session.

Design

--min-age 400 keeps any session that a running test could still be using. jest-server reuses a grid session only while it is at most 270 seconds old, and a test and its afterEach each time out after 50 seconds, so a session older than 400 seconds is not in use by any html2 test. The grid status has no idle time, so the script uses session age. Chrome nodes still end sessions idle for 300 seconds (SE_NODE_SESSION_TIMEOUT).

Specific Changes

  • SKILL.md: new "Build What You Changed" step, recommend cleanup-grid-sessions.py --min-age 400, name the actual cause of dist 404s, and add "writing tests" to when to use the skill

  • references/architecture.md

    • URL-to-folder table of what webchat2 serves (from docker-compose-wsl2.yml and serve-test.json)
    • Which packages to rebuild before testing
    • Why deleting and re-creating a served folder returns 404s until webchat2 restarts
    • Theme variant redirect pattern: which query parameters base tests read, with examples
  • references/failure-modes.md: rows for "old behavior after a source change" and "asset 404", plus a "Grid Sessions" section

  • scripts/cleanup-grid-sessions.py

    • --min-age SECONDS: delete only sessions started at least that long ago, and keep sessions with no start time
    • --dry-run: list sessions with their age and delete nothing
  • I have added tests and executed them locally

  • I have updated CHANGELOG.md

  • I have updated documentation

Testing: the script was run against a fake grid status with young, old, and no-start sessions (all option combinations, plus invalid --min-age). It was also run with --dry-run against a live grid, with one session it created and then deleted. Every documented URL was checked with curl against webchat2. The bind mount behavior was checked with a throwaway container.

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

- Document what `webchat2` serves (URL to folder), that source changes need a
  workspace build first, and why a re-created served folder returns 404s.
- Document the theme variant redirect pattern (`*.fluent.html`) and which
  query parameters base tests read.
- Add `--min-age` and `--dry-run` to `cleanup-grid-sessions.py`; without
  options it still deletes every session. Recommend `--min-age 400` on a
  shared grid so cleanup cannot kill another run's test.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Non-finite age input bypasses cleanup protection and can delete active sessions.

1 open issue
What changed in this PR

Improves HTML test guidance and adds age-filtered cleanup for shared Selenium grids.

Changes:

  • Documents rebuild requirements, asset URLs, and theme variants.
  • Adds --min-age and --dry-run cleanup options.
  • Updates troubleshooting and shared-grid guidance.
File Description
.github/​skills/​webchat-html-tests/​SKILL.md Expands test-writing and cleanup workflow.
.github/​skills/​webchat-html-tests/​scripts/​cleanup-grid-sessions.py Adds age filtering and dry-run support.
.github/​skills/​webchat-html-tests/​references/​failure-modes.md Documents build, asset, and session troubleshooting.
.github/​skills/​webchat-html-tests/​references/​architecture.md Explains served paths, rebuilds, and theme variants.

Review effort: Balanced


arguments = parser.parse_args()

arguments.min_age is not None and arguments.min_age < 0 and parser.error('--min-age must not be negative')
@OEvgeny Eugene (OEvgeny) assigned Copilot and unassigned Copilot Oct 17, 2026
@OEvgeny
Eugene (OEvgeny) enabled auto-merge (squash) October 17, 2026 03:33
@OEvgeny
Eugene (OEvgeny) merged commit be8266a into main Oct 17, 2026
33 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/dev-html-tests-skill branch October 17, 2026 03:36
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.

4 participants