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 catch all mock and temporary whitelist #26647

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Aug 26, 2024

Description

With this PR we add a catch all mock, which will prevent any test to send real requests to an API.
Status: all the failing tests indicate that they were using a real API, so they will need to add a mock. This task should be splitted into several teams, depending on the owner of the spec.
Once all the missing mocks are added, we'll be able to merge this PR.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2762

Manual testing steps

  1. Go to this page...

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.

Copy link
Contributor

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.

@seaona seaona added the area-qa Relating to QA work (Quality Assurance) label Aug 26, 2024
@gauthierpetetin
Copy link
Contributor

gauthierpetetin commented Sep 2, 2024

Notes from refinement session:

  • We can't merge this PR because some tests are failing (more than a hundred), due to not being mocked
  • We don't know which ones are missing mocks

Suggested next steps:

  • https://github.com/MetaMask/MetaMask-planning/issues/3203
  • For each missing mock, decide whether we want to add it or not. Ideally we decide to mock them all. However, some of these are owned by other teams and we can't always decide on their behalf.
    • If we decide to mock it, create an issue for it
    • If we decide not to mock it, add an exception in this PR (or do some refinement to discuss what we shall do in that case)

@seaona seaona changed the title test: add catch all mock test: add catch all mock and temporary whitelist Sep 9, 2024
} else if (
WHITE_LISTED_URLS.includes(url) ||
WHITE_LISTED_HOSTS.includes(host) ||
host.includes('gvt1.com')

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

'
gvt1.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.
Copy link

sonarcloud bot commented Sep 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-qa Relating to QA work (Quality Assurance) team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants