Skip to content

Conversation

@cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Nov 12, 2025

  • Closes

Additional details

If CYPRESS_INTERNAL_COMMAND_PERFORMANCE_LOGGING is enabled, Cypress will:

  • Create a new csv file at ./cypress/logs/performance.log, or $CYPRESS_INTERNAL_PERFORMANCE_LOG_FILE_PATH/performance.log if CYPRESS_INTERNAL_PERFORMANCE_LOG_FILE_PATH is set. This file is overwritten each time Cypress starts.
  • Append performance data to this file for every command:
    • startTime - when the Command Queue began executing the command
    • duration - How long the command took to execute
    • name - The name of the command
    • numElements - the number of elements associated with the command (for queries, this is the number of elements that match the query)
    • runnableTitle - the title of the runnable that enqueued the command
    • spec - the filename of the spec that included the runnable

Steps to test

How has the user experience changed?

PR Tasks


Note

Adds env-gated logging of each command’s execution timing to a CSV file and wires it through driver → automation (CDP/BiDi) → server.

  • Performance logging (opt-in via CYPRESS_INTERNAL_COMMAND_PERFORMANCE_LOGGING):
    • Driver: make runCommand async, measure startTime/duration, capture numElements, and emit Cypress.automation('log:command:performance', ...) from command_queue.ts.
    • Server: add record_performance_entry to append CSV rows to ./cypress/logs/performance.log (path override via CYPRESS_INTERNAL_PERFORMANCE_LOG_FILE_PATH) and initialize file on mode start (modes/index.ts).
    • Automation:
      • Wire new command log:command:performance through generic automation, plus CDP (cdp_automation.ts) and BiDi (bidi_automation.ts) handlers.
      • Extend types with CommandPerformanceEntry and new automation command in @packages/types.
    • Changelog: document the new benchmarking capability and default log location.

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

@cacieprins cacieprins marked this pull request as ready for review November 12, 2025 20:03

- The keyboard shortcuts modal now displays the keyboard shortcut for saving Studio changes - `` + `s` for Mac or `Ctrl` + `s` for Windows/Linux. Addressed [#32862](https://github.com/cypress-io/cypress/issues/32862). Addressed in [#32864](https://github.com/cypress-io/cypress/pull/32864).
- The Cursor logo now correctly displays in the External editor dropdown. Addresses [#32062](https://github.com/cypress-io/cypress/issues/32062). Addressed in [#32911](https://github.com/cypress-io/cypress/pull/32911).
- Command execution can be benchmarked by setting the `CYPRESS_INTERNAL_COMMAND_PERFORMANCE_LOGGING` environment variable to `1` or `true`. The performance log is recorded to `./cypress/logs/performance.log` by default. Addressed in [#32938](https://github.com/cypress-io/cypress/pull/32938)
Copy link
Member

Choose a reason for hiding this comment

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

@cacieprins If this is meant to be a user facing feature - I would not prefix this with CYPRESS_INTERNAL as that is used for truly internal env vars that users should never set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if it's something we want user-facing, it should be a config entry - but that's out of scope for this, I think. This is to prep for benchmarking visibility approaches

@cypress
Copy link

cypress bot commented Nov 12, 2025

cypress    Run #67307

Run Properties:  status check canceled Cancelled #67307  •  git commit 32afcfbc27: Merge branch 'develop' into csv-benchmark
Project cypress
Branch Review csv-benchmark
Run status status check canceled Cancelled #67307
Run duration 37m 54s
Commit git commit 32afcfbc27: Merge branch 'develop' into csv-benchmark
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 124
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 802
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 5134
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  38.71%
  Untested elements 166  
  Tested elements 108  
Accessibility  99.03%
  Failed rules  0 critical   6 serious   1 moderate   1 minor
  Failed elements 56  

Tests for review

Failed  memory/memory.cy.js • 0 failed tests • 5x-driver-chrome:beta

View Output

Test Artifacts
Failed  commands/actions/click.cy.ts • 0 failed tests • 5x-driver-chrome:beta

View Output

Test Artifacts
Failed  commands/actions/type_special_chars.cy.ts • 0 failed tests • 5x-driver-chrome:beta

View Output

Test Artifacts
Failed  commands/querying/querying.cy.ts • 0 failed tests • 5x-driver-chrome:beta

View Output

Test Artifacts
Failed  e2e/origin/cookie_behavior.cy.ts • 0 failed tests • 5x-driver-chrome:beta

View Output

Test Artifacts

The first 5 failed specs are shown, see all 1150 specs in Cypress Cloud.

path.join(logFilePath(), 'performance.log'),
`${row}\n`,
{ flag: 'a' },
)
Copy link

Choose a reason for hiding this comment

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

Bug: Resolve Asynchronous File Write Mismatch

fsSync.writeFile is the async callback-based version that requires a callback function as the last parameter. Without it, Node.js throws a runtime error. The function should use fsSync.writeFileSync instead to match the synchronous pattern used in initializePerformanceLogFile and work correctly within the try-catch block.

Fix in Cursor Fix in Web

@cacieprins cacieprins marked this pull request as draft November 13, 2025 16:38
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.

3 participants