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: remove MMI tests #29748

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .circleci/scripts/check_mmi_trigger.sh

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ module.exports = {
files: [
'**/__snapshots__/*.snap',
'app/scripts/controllers/app-state-controller.test.ts',
'app/scripts/controllers/mmi-controller.test.ts',
'app/scripts/controllers/alert-controller.test.ts',
'app/scripts/metamask-controller.actions.test.js',
'app/scripts/detect-multiple-instances.test.js',
Expand Down
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ app/scripts/lib/transaction/metrics.* @MetaMask/confirmations
app/scripts/lib/transaction/util.* @MetaMask/confirmations
ui/pages/confirmations @MetaMask/confirmations

# MMI team is responsible for code related with Institutioanl version of MetaMask
ui/pages/institutional @MetaMask/mmi
ui/components/institutional @MetaMask/mmi
ui/ducks/institutional @MetaMask/mmi
ui/selectors/institutional @MetaMask/mmi

# Design System to own code for the component-library folder
# Slack handle: @metamask-design-system-team | Slack channel: #metamask-design-system
ui/components/component-library @MetaMask/design-system-engineers
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/add-mmi-reviewer-and-notify.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/trigger-metamask-institutional-e2e-ci.yml

This file was deleted.

10 changes: 2 additions & 8 deletions .github/workflows/update-lavamoat-policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
matrix:
# Ensure this is synchronized with the list below in the "commit-updated-policies" job
# and with the build type list in `builds.yml`
build-type: [main, beta, flask, mmi]
build-type: [main, beta, flask]
name: Update LavaMoat ${{ matrix.build-type }} application policy
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
path: lavamoat/build-system
key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
# One restore step per build type: [main, beta, flask, mmi]
# One restore step per build type: [main, beta, flask]
# Ensure this is synchronized with the list above in the "update-lavamoat-webapp-policy" job
# and with the build type list in `builds.yml`
- name: Restore main application policy
Expand All @@ -175,12 +175,6 @@ jobs:
path: lavamoat/browserify/flask
key: cache-flask-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore mmi application policy
uses: actions/cache/restore@v4
with:
path: lavamoat/browserify/mmi
key: cache-mmi-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Check whether there are policy changes
id: policy-changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-lavamoat-policy-webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [main, beta, flask, mmi]
build-type: [main, beta, flask]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ test-results/
!.yarn/versions
development/generate-attributions/.yarn/*

# MMI Playwright
# Playwright
public/playwright
test/e2e/playwright/mmi/.env
test/e2e/playwright/mmi/playwright.config.ts
test/e2e/playwright/mmi/specs/**/*-darwin.png
test/e2e/playwright/mmi/dist/
lavamoat/**/policy-debug.json

# Attributions
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Before running e2e tests, ensure you've run `yarn install` to download dependenc
2. Create a custom test build: for testing against different build types, use `yarn build:test`. This command allows you to generate test builds for various types, including:
- `yarn build:test` for main build
- `yarn build:test:flask` for flask build
- `yarn build:test:mmi` for mmi build
- `yarn build:test:mv2` for mv2 build
3. Start a test build with live changes: `yarn start:test` is particularly useful for development. It starts a test build that automatically recompiles application code upon changes. This option is ideal for iterative testing and development. This command also allows you to generate test builds for various types, including:
- `yarn start:test` for main build
Expand Down Expand Up @@ -192,18 +191,10 @@ This approach ensures that your e2e tests accurately reflect the user experience
Different build types have different e2e tests sets. In order to run them look in the `package.json` file. You will find:

```console
"test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi",
"test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps",
"test:e2e:firefox": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js",
```

#### Note: Running MMI e2e tests

When running e2e on an MMI build you need to know that there are 2 separated set of tests:

- MMI runs a subset of MetaMask's e2e tests. To facilitate this, we have appended the `@no-mmi` tags to the names of those tests that are not applicable to this build type.
- MMI runs another specific set of e2e legacy tests which are better documented [here](test/e2e/mmi/README.md)

### Changing dependencies

Whenever you change dependencies (adding, removing, or updating, either in `package.json` or `yarn.lock`), there are various files that must be kept up-to-date.
Expand Down
5 changes: 0 additions & 5 deletions app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const METAMASK_ENVIRONMENT = process.env.METAMASK_ENVIRONMENT;
const RELEASE = process.env.METAMASK_VERSION;
const SENTRY_DSN = process.env.SENTRY_DSN;
const SENTRY_DSN_DEV = process.env.SENTRY_DSN_DEV;
const SENTRY_DSN_MMI = process.env.SENTRY_MMI_DSN;
/* eslint-enable prefer-destructuring */

// This is a fake DSN that can be used to test Sentry without sending data to the real Sentry server.
Expand Down Expand Up @@ -253,10 +252,6 @@ function getSentryTarget() {
return SENTRY_DSN_DEV;
}

if (METAMASK_BUILD_TYPE === 'mmi') {
return SENTRY_DSN_MMI;
}

if (!SENTRY_DSN) {
throw new Error(
`Missing SENTRY_DSN environment variable in production environment`,
Expand Down
32 changes: 1 addition & 31 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,6 @@ buildTypes:
manifestOverrides: ./app/build-types/flask/manifest/
buildNameOverride: MetaMask Flask

mmi:
id: 20
features:
- build-mmi
env:
- INFURA_MMI_PROJECT_ID
- SEGMENT_MMI_WRITE_KEY
- SENTRY_MMI_DSN
- INFURA_ENV_KEY_REF: INFURA_MMI_PROJECT_ID
- SEGMENT_WRITE_KEY_REF: SEGMENT_MMI_WRITE_KEY
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v2/configuration/default
- SUPPORT_LINK: https://support.metamask-institutional.io
- SUPPORT_REQUEST_LINK: https://support.metamask-institutional.io
- SENTRY_DSN: SENTRY_MMI_DSN
# For some reason, MMI uses this type of versioning
# Leaving it on for backwards compatibility
isPrerelease: true
manifestOverrides: ./app/build-types/mmi/manifest/
buildNameOverride: MetaMask Institutional

# Build types are composed of a set of features.
# Each feature can have code fences that add new code
# as well declaring, defining and overriding env variables
Expand All @@ -123,16 +99,12 @@ features:
# Assets that are exclusively included in this feature and ignored in others
# Supports globs
- ./{app,shared,ui}/**/beta/**
build-mmi:
assets:
- src: ./app/build-types/mmi/images/
dest: images
- ./{app,shared,ui}/**/institutional/**
build-flask:
assets:
- src: ./app/build-types/flask/images/
dest: images
- ./{app,shared,ui}/**/flask/**
build-mmi:
keyring-snaps:
assets:
- ./{app,shared,ui}/**/keyring-snaps/**
Expand Down Expand Up @@ -179,8 +151,6 @@ env:
- VERSION: null
- IS_CODESIGN_BUILD: null

- SENTRY_MMI_DSN: ''

###
# Storybook
###
Expand Down
7 changes: 1 addition & 6 deletions development/build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ const VARIABLES_REQUIRED_IN_PRODUCTION = {
main: ['INFURA_PROD_PROJECT_ID', 'SEGMENT_PROD_WRITE_KEY', 'SENTRY_DSN'],
beta: ['INFURA_BETA_PROJECT_ID', 'SEGMENT_BETA_WRITE_KEY', 'SENTRY_DSN'],
flask: ['INFURA_FLASK_PROJECT_ID', 'SEGMENT_FLASK_WRITE_KEY', 'SENTRY_DSN'],
mmi: [
'INFURA_MMI_PROJECT_ID',
'MMI_CONFIGURATION_SERVICE_URL',
'SEGMENT_MMI_WRITE_KEY',
'SENTRY_MMI_DSN',
],
mmi: [],
};

async function fromIniFile(filepath) {
Expand Down
10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
"start:with-state": "node ./app/scripts/start-with-wallet-state.mjs",
"start:mv2": "ENABLE_MV3=false yarn build:dev dev --apply-lavamoat=false --snow=false",
"start:flask": "yarn start --build-type flask",
"start:mmi": "yarn start --build-type mmi",
"start:lavamoat": "yarn build:dev dev --apply-lavamoat=true",
"dist": "yarn build dist",
"dist:mv2": "ENABLE_MV3=false yarn build dist",
"dist:mmi": "yarn dist --build-type mmi",
"dist:mmi:debug": "yarn dist --build-type mmi --apply-lavamoat=false --snow=false",
"build": "yarn lavamoat:build",
"build:dev": "node development/build/index.js",
"start:test": "yarn env:e2e build:dev testDev --apply-lavamoat=false",
Expand All @@ -35,7 +32,6 @@
"build:test:dev": "yarn env:e2e build:dev testDev --apply-lavamoat=false",
"build:test:flask": "yarn build:test --build-type flask",
"build:test:flask:mv2": "ENABLE_MV3=false yarn build:test:flask",
"build:test:mmi": "yarn build:test --build-type mmi",
"build:test:mv2": "ENABLE_MV3=false BLOCKAID_FILE_CDN=static.cx.metamask.io/api/v1/confirmations/ppom yarn build:test",
"build:test:webpack": "BLOCKAID_FILE_CDN=static.cx.metamask.io/api/v1/confirmations/ppom yarn env:e2e webpack --test --browser=chrome --no-cache --lockdown --sentry --snow",
"test": "yarn lint && yarn test:unit",
Expand All @@ -51,15 +47,9 @@
"test:integration": "npx webpack build --config ./development/webpack/webpack.integration.tests.config.ts && jest --config jest.integration.config.js",
"test:integration:coverage": "yarn test:integration --coverage",
"test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi",
"test:e2e:chrome:flask": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --build-type flask",
"test:e2e:chrome:webpack": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:api-specs": "SELENIUM_BROWSER=chrome ts-node test/e2e/run-openrpc-api-test-coverage.ts",
"test:e2e:mmi:ci": "yarn playwright test --project=mmi --project=mmi.visual",
"test:e2e:mmi:all": "yarn playwright test --project=mmi && yarn test:e2e:mmi:visual",
"test:e2e:mmi:regular": "yarn playwright test --project=mmi",
"test:e2e:mmi:visual": "./test/e2e/playwright/mmi/scripts/run-visual-test.sh check",
"test:e2e:mmi:visual:update": "./test/e2e/playwright/mmi/scripts/run-visual-test.sh update",
"test:e2e:swap": "yarn playwright test --project=swap",
"test:e2e:global": "yarn playwright test --project=global",
"test:e2e:pw:report": "yarn playwright show-report public/playwright/playwright-reports/html",
Expand Down
Loading
Loading