Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perf tests #383

Merged
merged 6 commits into from
Sep 26, 2023
Merged

Add perf tests #383

merged 6 commits into from
Sep 26, 2023

Conversation

GioSensation
Copy link
Member

@GioSensation GioSensation commented Sep 22, 2023

Reviewer: @shakyShane
Asana: https://app.asana.com/0/0/1205509987156724/f

Description

Add performance testing.

Steps to test

Let CI do its thing 🙂.

Signed-off-by: Emanuele Feliziani <[email protected]>
Signed-off-by: Emanuele Feliziani <[email protected]>
Signed-off-by: Emanuele Feliziani <[email protected]>
Signed-off-by: Emanuele Feliziani <[email protected]>
@GioSensation GioSensation self-assigned this Sep 22, 2023
for (let [keyName, value] of Object.entries(constants)) {
output = output.replace(new RegExp(`${keyName}: \\d+`), `${keyName}: ${value}`)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We're manipulating the source code with string substitution. A bit brutal but does the job. What's your thought on moving this to the remote config, so we can tweak it remotely if needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, I think better remote config integration is a must (as I've mentioned before given the advancements in C-S-S with this stuff)

But for this PR we shouldn't block on it. we do lots of replacements elsewhere and this is just for testing purposes so I see no issue.

Let's have a separate conversation about simplifying our 'Settings' class, now that we've been using it loads and we know what we do/don't need from it.


// we only care about the first one (for now)
const entry = entries[0]
console.log(`🏎💨 initial scan took: ${Math.round(entry.duration)}ms`)
Copy link
Member Author

Choose a reason for hiding this comment

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

The fancy emoji log helps with debugging, especially in CI (has already proven useful).


/**
* Tests for various Bitwarden scenarios on macos
*/
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved all the bitwarden stuff to a separate file to speed up the test suite. Here we have slow tests (because of timeouts) so moving it to a separate file speeds everything up (other tests can run in parallel).

const perfPage = scannerPerf(page)
perfPage.navigate('pages/usps_signup.html')

perfPage.validateInitialScanPerf(200)
Copy link
Member Author

Choose a reason for hiding this comment

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

These have some buffer to ensure they pass in CI.

Signed-off-by: Emanuele Feliziani <[email protected]>
@@ -22,6 +22,7 @@ const config = {
*/
timeout: 5000
},
fullyParallel: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Nice little setting to speed up local test execution 🎉.

@GioSensation GioSensation changed the title [WIP] Add perf tests Add perf tests Sep 22, 2023
@GioSensation GioSensation marked this pull request as ready for review September 22, 2023 16:21
for (let [keyName, value] of Object.entries(constants)) {
output = output.replace(new RegExp(`${keyName}: \\d+`), `${keyName}: ${value}`)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, I think better remote config integration is a must (as I've mentioned before given the advancements in C-S-S with this stuff)

But for this PR we shouldn't block on it. we do lots of replacements elsewhere and this is just for testing purposes so I see no issue.

Let's have a separate conversation about simplifying our 'Settings' class, now that we've been using it loads and we know what we do/don't need from it.

@GioSensation GioSensation merged commit e18944b into main Sep 26, 2023
1 check passed
@GioSensation GioSensation deleted the ema/add-perf-tests branch September 26, 2023 12:21
brindy added a commit to duckduckgo/macos-browser that referenced this pull request Sep 28, 2023
Task/Issue URL:
https://app.asana.com/0/1205602928782192/1205602928782192
Autofill Release:
https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/8.4.1
BSK PR: duckduckgo/BrowserServicesKit#517

## Description
Updates Autofill to version
[8.4.1](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/8.4.1).

### Autofill 8.4.1 release notes
## What's Changed
* Precompile regexes by @GioSensation in
duckduckgo/duckduckgo-autofill#382
* Add perf tests by @GioSensation in
duckduckgo/duckduckgo-autofill#383
* deps: remove deprecated content-scope-utils by @shakyShane in
duckduckgo/duckduckgo-autofill#384
* Update dependencies by @GioSensation in
duckduckgo/duckduckgo-autofill#368
* Fix perf regressions by @GioSensation in
duckduckgo/duckduckgo-autofill#385


**Full Changelog**:
duckduckgo/duckduckgo-autofill@8.4.0...8.4.1

## Steps to test
This release has been tested during autofill development. For smoke test
steps see [this
task](https://app.asana.com/0/1198964220583541/1200583647142330/f).

---------

Co-authored-by: GioSensation <[email protected]>
Co-authored-by: Chris Brind <[email protected]>
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.

2 participants