Skip to content

fix: use sdk-js 5.7.2 so cy.vrtStop() finishes the build - #274

Merged
pashidlos merged 2 commits into
masterfrom
fix/486-vrt-stop
Oct 24, 2026
Merged

pashidlos merged 2 commits into
masterfrom
fix/486-vrt-stop

Conversation

@pashidlos

@pashidlos pashidlos commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Problem

cy.vrtStop() runs without errors, but the build stays Running in VRT (Visual-Regression-Tracker/Visual-Regression-Tracker#486).

Root cause

agent-cypress itself is fine: the VRT_STOP task awaits vrt.stop() and reports errors (lib/plugin.ts). The bug is in sdk-js. stop() sends PATCH /builds/:id with an empty body, and current backends no longer treat an empty body as isRunning: false. That is fixed in Visual-Regression-Tracker/sdk-js#345 (which supersedes sdk-js#343).

agent-cypress pins sdk-js to an exact version (5.7.0, 5.7.1 after #273). So Cypress users get the fix only after:

  1. sdk-js#345 is merged and released (semantic-release should publish 5.7.2), and
  2. this repo bumps the pin and is released.

This PR

  • New lib/plugin.spec.ts: registers the plugin, runs the VRT_START and VRT_STOP tasks against a local stub HTTP server and checks the requests the real sdk-js sends. Stop must PATCH /builds/<id> with { isRunning: false }. A second test checks that stop does nothing when not started.

  • npm test script, Jest limited to lib/ (the cypress/ specs need the Cypress runner), specs excluded from dist/, unit tests run in CI. @jest/globals is imported explicitly because the global expect type is Cypress' chai one.

  • Pins @visual-regression-tracker/sdk-js to 5.7.2 (published 2026-10-24 via npm trusted publishing), which sends { isRunning: false } on stop.

With sdk-js 5.7.1 the stop test failed (it received body: {}), reproducing #486. With 5.7.2: 2 passed. Build passes.

Keep the fix: title when squash-merging so semantic-release publishes a new agent-cypress version.

Fixes Visual-Regression-Tracker/Visual-Regression-Tracker#486

🤖 Generated with Claude Code

Pavlo Strunkin and others added 2 commits October 24, 2026 13:14
Register the plugin, run the VRT_START and VRT_STOP tasks against a
local HTTP server and check the requests the real sdk-js sends: stop
must PATCH the started build with { isRunning: false } (issue #486).
Fails with sdk-js 5.7.1, which sends an empty body. Passes with the
sdk-js fix (Visual-Regression-Tracker/sdk-js#345).

Add an npm test script, keep jest out of the Cypress e2e specs, keep
spec files out of dist and run the unit tests in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sdk-js 5.7.2 sends isRunning: false when stopping a build.

Fixes Visual-Regression-Tracker/Visual-Regression-Tracker#486

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pashidlos
pashidlos marked this pull request as ready for review October 24, 2026 10:14
@pashidlos pashidlos changed the title fix: use sdk-js with the build stop fix so cy.vrtStop() finishes the build fix: use sdk-js 5.7.2 so cy.vrtStop() finishes the build Oct 24, 2026
@pashidlos
pashidlos merged commit a6ec670 into master Oct 24, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cy.vrtStop() does not mark the test/build as completed

1 participant