Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add basic performance testing via Cypress #8586

Merged
merged 10 commits into from
May 17, 2022
Merged

Conversation

jryans
Copy link
Collaborator

@jryans jryans commented May 13, 2022

This adds a basic approach to performance testing within Cypress tests. You sprinkle cy.startMeasuring / cy.stopMeasuring pairs in the areas of interest. The measurements are added to the Cypress log shown in interactive
runs and they are also assembled into a dashboard (https://matrix-org.github.io/matrix-react-sdk/cypress/bench/, only updated for develop runs, so nothing there yet) for tracking changes across time.

Fixes element-hq/element-web#21738


This change is marked as an internal change (Task), so will not be included in the changelog.

jryans added 2 commits May 13, 2022 10:53
This adds a basic approach to performance testing within Cypress tests. You
sprinkle `cy.startMeasuring` / `cy.stopMeasuring` pairs in the areas of
interest. The measurements are added to the Cypress log shown in interactive
runs and they are also assembled into a dashboard
(https://matrix-org.github.io/matrix-react-sdk/cypress/bench/) for tracking
changes across time.

Fixes element-hq/element-web#21738
@jryans jryans added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label May 13, 2022
@@ -40,17 +40,16 @@ jobs:
test/end-to-end-tests/synapse/installations/consent/homeserver.log
retention-days: 14

- name: Download previous benchmark data
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a dead block, as we aren't using the "separate file" version of this benchmark action.

@jryans
Copy link
Collaborator Author

jryans commented May 13, 2022

The measure commands have upset Cypress in a few spots, so I'm leaving this as a draft for the moment. I should be able to sort those out in the next few days.

Comment on lines +70 to +71
// Needed to make this file a module
export { };
Copy link
Member

Choose a reason for hiding this comment

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

Ah that's the thing I was missing for the two files with dummy imports 🤦

@jryans jryans marked this pull request as ready for review May 15, 2022 21:25
@jryans jryans requested a review from a team as a code owner May 15, 2022 21:25
@jryans
Copy link
Collaborator Author

jryans commented May 15, 2022

Okay, seems to be working now! 😄

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

LGTM otherwise, let me know whether you agree on the prefixing

.github/workflows/element-build-and-test.yaml Show resolved Hide resolved
cypress/integration/1-register/register.spec.ts Outdated Show resolved Hide resolved
# The dashboard is available at https://matrix-org.github.io/matrix-react-sdk/cypress/bench/
benchmark-data-dir-path: cypress/bench
fail-on-alert: false
comment-on-alert: false
Copy link
Contributor

Choose a reason for hiding this comment

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

why not enable either of these?

Copy link
Collaborator Author

@jryans jryans May 17, 2022

Choose a reason for hiding this comment

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

Could do, up to the team really. The current configuration is just copied from a previous usage of this benchmarking action. Perhaps it would be good to get a few data points in the dashboard and then define an appropriate threshold for alerting?

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@jryans jryans merged commit c122c5c into develop May 17, 2022
@jryans jryans deleted the jryans/performance-testing branch May 17, 2022 14:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automated performance testing
3 participants