Skip to content

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Oct 2, 2025

  • Closes

Additional details

System tests currently fetch typescript definitions and example payloads for API endpoints when they run. This ensures our api calls are supported properly by the server.

This adds the same functionality to packages/server, so we can make sure our api functions use up-to-date typedefs from Cypress Cloud

Steps to test

How has the user experience changed?

PR Tasks


Note

Switches server API request/response types to Cloud validations and adds scripts to fetch them, with minor logic, typing, and error-handling updates.

  • Cloud validations integration:
    • Import and use ../../validations/cloudValidations types for createRun, createInstance, postInstanceResults, postInstanceTests, and updateInstanceStdout.
    • Replace in-file request/response interfaces with Cloud-provided types; add PutInstanceArtifactsResponseType placeholder type.
  • Build & scripts:
    • Add scripts/sync-cloud-validations.sh and wire to postinstall, build-prod, and check-ts via sync-cloud-validations/ensure-cloud-validations.
    • Add dependency zod; ignore generated lib/validations in repo (.gitignore).
  • API/typing refinements:
    • Strengthen method signatures and return types across lib/cloud/api/index.ts and create_instance.ts (incl. setPreflightResult, resetPreflightResult, ping, etc.).
    • Use Cloud types in createInstance request/response; keep retry/backoff behavior.
  • Recording flow tweaks:
    • Only mount capture protocol when testingType is e2e or component.
    • Refactor _postInstanceTests to async with try/catch; adjust onTestsReceived to handle failures by hanging the browser and handle SPEC SKIP actions.

Written by Cursor Bugbot for commit 681153e. This will update automatically on new commits. Configure here.

Copy link

cypress bot commented Oct 2, 2025

cypress    Run #66051

Run Properties:  status check passed Passed #66051  •  git commit 36318c2592: consolidate zod versions
Project cypress
Branch Review chore/use-api-typedefs
Run status status check passed Passed #66051
Run duration 20m 20s
Commit git commit 36318c2592: consolidate zod versions
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 10
Tests that did not run due to a developer annotating a test with .skip  Pending 1102
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 26666
View all changes introduced in this branch ↗︎
UI Coverage  44.86%
  Untested elements 188  
  Tested elements 157  
Accessibility  97.71%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 110  

@cacieprins cacieprins marked this pull request as ready for review October 3, 2025 15:09
@cacieprins cacieprins self-assigned this Oct 3, 2025
return
return cb(response)
} catch (err: unknown) {
debug('postInstanceTests failed, allowing browser to hang until it is killed: Error %o', { err })
Copy link

Choose a reason for hiding this comment

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

Bug: Error Handling Skipped After Refactor

The refactor removed the onError(err) callback invocation when _postInstanceTests fails. Errors are now only logged, skipping the onError call that previously handled error reporting or cleanup logic.

Fix in Cursor Fix in Web

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.

1 participant