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

test: add blacklist URLs to automated tests #8558

Merged
merged 41 commits into from
Feb 15, 2024
Merged

Conversation

chrisleewilcox
Copy link
Contributor

@chrisleewilcox chrisleewilcox commented Feb 8, 2024

Description

This PR decreases delays in mobile automated testruns by blacklisting URLs that do not have any impact on tests. Request made from the app that take awhile to resolve delays the tests running. Blacklisted URLs that don't impact tests will allow the test to continue to execute without waiting for request to resolve for blacklisted URLs.

Running automated tests locally shows a more noticeable improvement.

Information related to how blacklisting URLs using detox: https://wix.github.io/Detox/docs/api/device/#deviceseturlblacklisturls
https://wix.github.io/Detox/docs/api/device/#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch
https://wix.github.io/Detox/docs/api/device/#deviceapplaunchargs

Challenges encountered can be found here.

Related issues

Fixes: #https://github.com/MetaMask/mobile-planning/issues/1532

Manual testing steps

Scenario: Running tests on bitrise

Given I am on bitrise
And blacklisted URLs have been implemented
When I kick-off automation tests pipeline
Then all tests pass when pipelines are complete
And testrun duration is decreased
And bitrise credit usage is decreased

Scenario: Running tests locally

Given blacklist URLs have been implemented
When I run automation tests on my local system
Then blacklisted URLs will not show as waiting for response in terminal output
And all tests pass

Screenshots/Recordings

Before

Screen.Recording.2024-02-12.at.12.41.06.AM.mov

https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a8db46fc-f8ba-4e9b-9180-3e0b0656d1fc
image

https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2adb4469-2e8d-4541-b608-8f8974eb097f
image

After

Screen.Recording.2024-02-12.at.11.08.18.AM.mov

https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e6127952-b019-41e5-9e7b-b0a2bd449f01
image

https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/772698e3-594f-4f68-bf76-63b01b87398a
image

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@chrisleewilcox chrisleewilcox self-assigned this Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7012f65) 40.90% compared to head (f053b36) 41.08%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8558      +/-   ##
==========================================
+ Coverage   40.90%   41.08%   +0.18%     
==========================================
  Files        1245     1245              
  Lines       30150    30330     +180     
  Branches     2895     2962      +67     
==========================================
+ Hits        12333    12462     +129     
- Misses      17114    17125      +11     
- Partials      703      743      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chrisleewilcox chrisleewilcox added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 9, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8d629dc6-7dc7-446f-aa7c-3e327d6ce10c
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@chrisleewilcox chrisleewilcox marked this pull request as ready for review February 9, 2024 16:47
@chrisleewilcox chrisleewilcox requested a review from a team as a code owner February 9, 2024 16:47
@chrisleewilcox chrisleewilcox added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 13, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f008d8e9-648a-4be2-ad34-8efb9862b323
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

e2e/helpers.js Outdated Show resolved Hide resolved
e2e/resources/blacklistURLs.json Outdated Show resolved Hide resolved
e2e/helpers.js Outdated Show resolved Hide resolved
@metamaskbot metamaskbot added in-progress and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Feb 14, 2024
SamuelSalas
SamuelSalas previously approved these changes Feb 14, 2024
Copy link
Member

@SamuelSalas SamuelSalas left a comment

Choose a reason for hiding this comment

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

LGTM

@chrisleewilcox chrisleewilcox added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 15, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f2e0bd98-1f5c-45dc-a610-b54099b97c46
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

✅ ✅

@SamuelSalas SamuelSalas merged commit bad7725 into main Feb 15, 2024
26 checks passed
@SamuelSalas SamuelSalas deleted the test/blacklist-URLs branch February 15, 2024 16:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
@metamaskbot metamaskbot added the release-7.17.0 Issue or pull request that will be included in release 7.17.0 label Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E2E release-7.17.0 Issue or pull request that will be included in release 7.17.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants