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: Refactor e2e Swap test to use Tenderly Virtual TestNets #11670

Merged
merged 57 commits into from
Jan 15, 2025

Conversation

davibroc
Copy link
Contributor

@davibroc davibroc commented Oct 7, 2024

Description

Improvements:

  • refactored the code to use Virtual TestNets instead of Forks on Tenderly network
  • switched to Tenderly corporate account as previously we were using my personal
  • added swap teston different networks: Polygon because of the high volume and Optimism as we specifically handle that network differently
  • added swap test on Mainnet after changing networks, source of bugs in the past
  • added swap test of unapproved tokens
  • added swap of ERC20->ERC20
  • fixed token chart swap test flakiness
  • re-enabled tests on Bitrise

Did the following runs on Bitrise and all passed:

Smoke:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/735ec2e0-176b-4b27-833b-b4b92a824f2f
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b2808861-82a0-41d1-996d-9a1e7aa91624
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/170c45e8-0a23-45a3-9f27-80e1f5a3e919

Regression:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/41c57b42-ba59-4091-a774-590e767b6346
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a8abe55d-e9cd-4ab3-b891-ff98b4378952
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fe20c226-8a5e-475e-908e-7b41017c25e9

Related issues

Fixes:

Manual testing steps

yarn test:e2e:ios:debug:run e2e/specs/swaps/swap-action-smoke.spec.js
yarn test:e2e:ios:debug:run e2e/specs/swaps/swap-action-regression.spec.js
yarn test:e2e:ios:debug:run e2e/specs/swaps/swap-token-chart.spec.js

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@davibroc davibroc requested a review from a team as a code owner October 7, 2024 21:39
Copy link
Contributor

github-actions bot commented Oct 7, 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.

@davibroc davibroc added No QA Needed Apply this label when your PR does not need any QA effort. team-swaps and removed No QA Needed Apply this label when your PR does not need any QA effort. labels Oct 7, 2024
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from 5eb8e18 to a778182 Compare October 8, 2024 18:14
@davibroc davibroc requested review from a team as code owners October 8, 2024 18:14
@davibroc davibroc added the No QA Needed Apply this label when your PR does not need any QA effort. label Oct 8, 2024
Andepande
Andepande previously approved these changes Oct 9, 2024
Copy link
Member

@Andepande Andepande left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Great work @davibroc ! I Left a few comments. You should also blacklist all requests made to tenderly virtual testnet (This regex would suffice that: .*rpc.vnet.tenderly.co/.*) as detox will wait until the requests are resolved before continuing test execution. I say this because, in some instances, this introduced performance issues for our tests.

e2e/pages/swaps/SwapView.js Outdated Show resolved Hide resolved
e2e/specs/swaps/swap-action-regression.spec.js Outdated Show resolved Hide resolved
e2e/specs/swaps/swap-action-smoke.spec.js Outdated Show resolved Hide resolved
e2e/specs/swaps/swap-action-smoke.spec.js Show resolved Hide resolved
e2e/fixtures/fixture-builder.js Outdated Show resolved Hide resolved
e2e/fixtures/fixture-builder.js Outdated Show resolved Hide resolved
e2e/resources/networks.e2e.js Show resolved Hide resolved
e2e/resources/networks.e2e.js Show resolved Hide resolved
e2e/resources/networks.e2e.js Show resolved Hide resolved
@davibroc davibroc linked an issue Oct 16, 2024 that may be closed by this pull request
9 tasks
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch 2 times, most recently from 82c7550 to a80ebdf Compare October 24, 2024 19:46
Copy link

@davibroc davibroc requested a review from cortisiko October 25, 2024 16:39
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from befb593 to 0d9048e Compare October 28, 2024 21:55
@davibroc davibroc requested a review from a team as a code owner October 28, 2024 21:55
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from 36acd76 to 1d4f9f5 Compare October 29, 2024 11:08
@cortisiko cortisiko self-requested a review October 31, 2024 23:38
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from 1d4f9f5 to 0c642fa Compare November 5, 2024 13:06
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from 0c642fa to 885229a Compare November 22, 2024 21:53
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch 2 times, most recently from 82ed980 to 302e447 Compare December 9, 2024 16:31
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from f69e0c2 to a8f93ce Compare December 11, 2024 11:04
@davibroc davibroc added the Run Smoke E2E Triggers smoke e2e on Bitrise label Dec 11, 2024
Copy link
Contributor

github-actions bot commented Dec 11, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: a8f93ce
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ebf12a40-f2ea-40d1-90dd-57cad987eb74

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@davibroc davibroc removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Dec 11, 2024
@davibroc davibroc force-pushed the test/swithc-to-virtual-testnets branch from d833004 to 2c28136 Compare January 15, 2025 01:52
@davibroc davibroc added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 2c28136
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d2b64c04-a8d3-47d9-957b-befb089ee04c

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@davibroc davibroc added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 15, 2025
@davibroc davibroc enabled auto-merge January 15, 2025 04:39
@davibroc davibroc added this pull request to the merge queue Jan 15, 2025
Merged via the queue into main with commit 4dcc21f Jan 15, 2025
43 checks passed
@davibroc davibroc deleted the test/swithc-to-virtual-testnets branch January 15, 2025 20:47
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2025
@metamaskbot metamaskbot added the release-7.39.0 Issue or pull request that will be included in release 7.39.0 label Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.39.0 Issue or pull request that will be included in release 7.39.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-swaps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address issues with swaps e2e tests
4 participants