1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Enable snaps in stable (#19134)

* Enable Snaps feature flag in stable

* Run snaps E2Es in stable

* Fix CI config indentation

* Fix CI paths

* Update LavaMoat policies

* Update iframe URL

* Exclude some tests from running in stable e2e

* Disable another test on stable

* Bump to 1.0.1

* Fix config.yml issue due to staleness

* Stop running newly added test

* Update snapshots used for E2E

* Use shallow-git-clone
This commit is contained in:
Frederik Bolding 2023-08-17 15:43:01 +02:00 committed by Dan J Miller
parent 5505bc19e2
commit e9c641dfcd
7 changed files with 603 additions and 60 deletions

View File

@ -146,8 +146,14 @@ workflows:
- prep-build-test - prep-build-test
- test-e2e-chrome-snaps: - test-e2e-chrome-snaps:
requires: requires:
- prep-build-test-flask - prep-build-test
- test-e2e-firefox-snaps: - test-e2e-firefox-snaps:
requires:
- prep-build-test
- test-e2e-chrome-snaps-flask:
requires:
- prep-build-test-flask
- test-e2e-firefox-snaps-flask:
requires: requires:
- prep-build-test-flask - prep-build-test-flask
- test-e2e-chrome-mv3: - test-e2e-chrome-mv3:
@ -770,6 +776,80 @@ jobs:
destination: test-artifacts destination: test-artifacts
test-e2e-firefox-snaps: test-e2e-firefox-snaps:
executor: node-browsers
parallelism: 4
steps:
- run: *shallow-git-clone
- run:
name: Install Firefox
command: ./.circleci/scripts/firefox-install.sh
- attach_workspace:
at: .
- run:
name: Move test build to dist
command: mv ./dist-test ./dist
- run:
name: Move test zips to builds
command: mv ./builds-test ./builds
- run:
name: test:e2e:firefox:snaps
command: |
if .circleci/scripts/test-run-e2e.sh
then
yarn test:e2e:firefox:snaps --retries 2 --debug --build-type=main
fi
no_output_timeout: 20m
- run:
name: Merge JUnit report
command: |
if [ "$(ls -A test/test-results/e2e)" ]; then
yarn test:e2e:report
fi
when: always
- store_artifacts:
path: test-artifacts
destination: test-artifacts
- store_test_results:
path: test/test-results/e2e.xml
test-e2e-chrome-snaps:
executor: node-browsers
parallelism: 4
steps:
- run: *shallow-git-clone
- run:
name: Re-Install Chrome
command: ./.circleci/scripts/chrome-install.sh
- attach_workspace:
at: .
- run:
name: Move test build to dist
command: mv ./dist-test ./dist
- run:
name: Move test zips to builds
command: mv ./builds-test ./builds
- run:
name: test:e2e:chrome:snaps
command: |
if .circleci/scripts/test-run-e2e.sh
then
yarn test:e2e:chrome:snaps --retries 2 --debug --build-type=main
fi
no_output_timeout: 20m
- run:
name: Merge JUnit report
command: |
if [ "$(ls -A test/test-results/e2e)" ]; then
yarn test:e2e:report
fi
when: always
- store_artifacts:
path: test-artifacts
destination: test-artifacts
- store_test_results:
path: test/test-results/e2e.xml
test-e2e-firefox-snaps-flask:
executor: node-browsers executor: node-browsers
parallelism: 4 parallelism: 4
steps: steps:
@ -806,7 +886,7 @@ jobs:
- store_test_results: - store_test_results:
path: test/test-results/e2e.xml path: test/test-results/e2e.xml
test-e2e-chrome-snaps: test-e2e-chrome-snaps-flask:
executor: node-browsers executor: node-browsers
parallelism: 4 parallelism: 4
steps: steps:

View File

@ -16,12 +16,16 @@ buildTypes:
main: main:
features: features:
- build-main - build-main
- snaps
# Additional env variables that are specific to this build # Additional env variables that are specific to this build
env: env:
- INFURA_PROD_PROJECT_ID - INFURA_PROD_PROJECT_ID
- SEGMENT_PROD_WRITE_KEY - SEGMENT_PROD_WRITE_KEY
- INFURA_ENV_KEY_REF: INFURA_PROD_PROJECT_ID - INFURA_ENV_KEY_REF: INFURA_PROD_PROJECT_ID
- SEGMENT_WRITE_KEY_REF: SEGMENT_PROD_WRITE_KEY - SEGMENT_WRITE_KEY_REF: SEGMENT_PROD_WRITE_KEY
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/1.0.1/index.html
# Main build uses the default browser manifest # Main build uses the default browser manifest
manifestOverrides: false manifestOverrides: false

View File

@ -1660,6 +1660,13 @@
"browserify>events": true "browserify>events": true
} }
}, },
"@metamask/notification-controller": {
"packages": {
"@metamask/base-controller": true,
"@metamask/notification-controller>nanoid": true,
"@metamask/utils": true
}
},
"@metamask/notification-controller>nanoid": { "@metamask/notification-controller>nanoid": {
"globals": { "globals": {
"crypto.getRandomValues": true "crypto.getRandomValues": true
@ -1716,6 +1723,98 @@
"eslint>optionator>fast-levenshtein": true "eslint>optionator>fast-levenshtein": true
} }
}, },
"@metamask/post-message-stream": {
"globals": {
"MessageEvent.prototype": true,
"WorkerGlobalScope": true,
"addEventListener": true,
"browser": true,
"chrome": true,
"location.origin": true,
"postMessage": true,
"removeEventListener": true
},
"packages": {
"@metamask/post-message-stream>readable-stream": true,
"@metamask/utils": true
}
},
"@metamask/post-message-stream>readable-stream": {
"packages": {
"@metamask/post-message-stream>readable-stream>process-nextick-args": true,
"@metamask/post-message-stream>readable-stream>safe-buffer": true,
"@metamask/post-message-stream>readable-stream>string_decoder": true,
"browserify>browser-resolve": true,
"browserify>events": true,
"browserify>process": true,
"browserify>timers-browserify": true,
"pumpify>inherits": true,
"readable-stream>core-util-is": true,
"readable-stream>isarray": true,
"readable-stream>util-deprecate": true
}
},
"@metamask/post-message-stream>readable-stream>process-nextick-args": {
"packages": {
"browserify>process": true
}
},
"@metamask/post-message-stream>readable-stream>safe-buffer": {
"packages": {
"browserify>buffer": true
}
},
"@metamask/post-message-stream>readable-stream>string_decoder": {
"packages": {
"@metamask/post-message-stream>readable-stream>safe-buffer": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/providers>@metamask/object-multiplex": {
"globals": {
"console.warn": true
},
"packages": {
"end-of-stream": true,
"pump>once": true,
"readable-stream": true
}
},
"@metamask/rate-limit-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/base-controller": true,
"eth-rpc-errors": true
}
},
"@metamask/rpc-methods": { "@metamask/rpc-methods": {
"packages": { "packages": {
"@metamask/browser-passworder": true, "@metamask/browser-passworder": true,
@ -1853,23 +1952,35 @@
"define": true "define": true
} }
}, },
"@metamask/smart-transactions-controller>isomorphic-fetch": { "@metamask/snaps-controllers": {
"globals": { "globals": {
"fetch.bind": true "URL": true,
"chrome.offscreen.createDocument": true,
"chrome.offscreen.hasDocument": true,
"clearTimeout": true,
"document.getElementById": true,
"fetch.bind": true,
"setTimeout": true
}, },
"packages": { "packages": {
"@metamask/smart-transactions-controller>isomorphic-fetch>whatwg-fetch": true "@metamask/base-controller": true,
} "@metamask/permission-controller": true,
}, "@metamask/post-message-stream": true,
"@metamask/smart-transactions-controller>isomorphic-fetch>whatwg-fetch": { "@metamask/providers>@metamask/object-multiplex": true,
"globals": { "@metamask/rpc-methods": true,
"Blob": true, "@metamask/snaps-controllers>@metamask/utils": true,
"FileReader": true, "@metamask/snaps-controllers>@xstate/fsm": true,
"FormData": true, "@metamask/snaps-controllers>concat-stream": true,
"URLSearchParams.prototype.isPrototypeOf": true, "@metamask/snaps-controllers>gunzip-maybe": true,
"XMLHttpRequest": true, "@metamask/snaps-controllers>nanoid": true,
"define": true, "@metamask/snaps-controllers>readable-web-to-node-stream": true,
"setTimeout": true "@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-utils": true,
"@metamask/snaps-utils>@metamask/snaps-registry": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"json-rpc-middleware-stream": true,
"pump": true
} }
}, },
"@metamask/snaps-controllers-flask>nanoid": { "@metamask/snaps-controllers-flask>nanoid": {
@ -1877,11 +1988,167 @@
"crypto.getRandomValues": true "crypto.getRandomValues": true
} }
}, },
"@metamask/snaps-controllers>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/snaps-controllers>concat-stream": {
"packages": {
"@metamask/snaps-controllers>concat-stream>readable-stream": true,
"browserify>buffer": true,
"browserify>concat-stream>typedarray": true,
"pumpify>inherits": true,
"terser>source-map-support>buffer-from": true
}
},
"@metamask/snaps-controllers>concat-stream>readable-stream": {
"packages": {
"browserify>browser-resolve": true,
"browserify>buffer": true,
"browserify>events": true,
"browserify>process": true,
"browserify>string_decoder": true,
"pumpify>inherits": true,
"readable-stream>util-deprecate": true
}
},
"@metamask/snaps-controllers>gunzip-maybe": {
"packages": {
"@metamask/snaps-controllers>gunzip-maybe>browserify-zlib": true,
"@metamask/snaps-controllers>gunzip-maybe>is-deflate": true,
"@metamask/snaps-controllers>gunzip-maybe>is-gzip": true,
"@metamask/snaps-controllers>gunzip-maybe>peek-stream": true,
"@metamask/snaps-controllers>gunzip-maybe>pumpify": true,
"@metamask/snaps-controllers>gunzip-maybe>through2": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>browserify-zlib": {
"packages": {
"@metamask/snaps-controllers>gunzip-maybe>browserify-zlib>pako": true,
"browserify>assert": true,
"browserify>buffer": true,
"browserify>process": true,
"browserify>util": true,
"readable-stream": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>peek-stream": {
"packages": {
"@metamask/snaps-controllers>gunzip-maybe>peek-stream>duplexify": true,
"@metamask/snaps-controllers>gunzip-maybe>peek-stream>through2": true,
"browserify>buffer": true,
"terser>source-map-support>buffer-from": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>peek-stream>duplexify": {
"packages": {
"browserify>buffer": true,
"browserify>process": true,
"duplexify>stream-shift": true,
"end-of-stream": true,
"pumpify>inherits": true,
"readable-stream": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>peek-stream>through2": {
"packages": {
"browserify>process": true,
"browserify>util": true,
"readable-stream": true,
"watchify>xtend": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>pumpify": {
"packages": {
"@metamask/snaps-controllers>gunzip-maybe>pumpify>duplexify": true,
"@metamask/snaps-controllers>gunzip-maybe>pumpify>pump": true,
"pumpify>inherits": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>pumpify>duplexify": {
"packages": {
"browserify>buffer": true,
"browserify>process": true,
"duplexify>stream-shift": true,
"end-of-stream": true,
"pumpify>inherits": true,
"readable-stream": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>pumpify>pump": {
"packages": {
"browserify>browser-resolve": true,
"end-of-stream": true,
"pump>once": true
}
},
"@metamask/snaps-controllers>gunzip-maybe>through2": {
"packages": {
"browserify>process": true,
"browserify>util": true,
"readable-stream": true,
"watchify>xtend": true
}
},
"@metamask/snaps-controllers>nanoid": { "@metamask/snaps-controllers>nanoid": {
"globals": { "globals": {
"crypto.getRandomValues": true "crypto.getRandomValues": true
} }
}, },
"@metamask/snaps-controllers>readable-web-to-node-stream": {
"packages": {
"@metamask/snaps-controllers>readable-web-to-node-stream>readable-stream": true
}
},
"@metamask/snaps-controllers>readable-web-to-node-stream>readable-stream": {
"packages": {
"browserify>browser-resolve": true,
"browserify>buffer": true,
"browserify>events": true,
"browserify>process": true,
"browserify>string_decoder": true,
"pumpify>inherits": true,
"readable-stream>util-deprecate": true
}
},
"@metamask/snaps-controllers>tar-stream": {
"packages": {
"@metamask/snaps-controllers>tar-stream>fs-constants": true,
"@metamask/snaps-controllers>tar-stream>readable-stream": true,
"browserify>buffer": true,
"browserify>process": true,
"browserify>string_decoder": true,
"browserify>util": true,
"end-of-stream": true,
"madge>ora>bl": true,
"pumpify>inherits": true
}
},
"@metamask/snaps-controllers>tar-stream>fs-constants": {
"packages": {
"browserify>constants-browserify": true
}
},
"@metamask/snaps-controllers>tar-stream>readable-stream": {
"packages": {
"browserify>browser-resolve": true,
"browserify>buffer": true,
"browserify>events": true,
"browserify>process": true,
"browserify>string_decoder": true,
"pumpify>inherits": true,
"readable-stream>util-deprecate": true
}
},
"@metamask/snaps-ui": { "@metamask/snaps-ui": {
"packages": { "packages": {
"@metamask/snaps-ui>@metamask/utils": true, "@metamask/snaps-ui>@metamask/utils": true,
@ -1934,6 +2201,26 @@
"@metamask/snaps-utils>@metamask/utils": true "@metamask/snaps-utils>@metamask/utils": true
} }
}, },
"@metamask/snaps-utils>@metamask/snaps-registry": {
"packages": {
"@metamask/key-tree>@noble/secp256k1": true,
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/snaps-utils>@metamask/utils": { "@metamask/snaps-utils>@metamask/utils": {
"globals": { "globals": {
"TextDecoder": true, "TextDecoder": true,
@ -4059,6 +4346,39 @@
"Intl": true "Intl": true
} }
}, },
"madge>ora>bl": {
"packages": {
"browserify>buffer": true,
"madge>ora>bl>readable-stream": true,
"pumpify>inherits": true
}
},
"madge>ora>bl>readable-stream": {
"packages": {
"browserify>browser-resolve": true,
"browserify>buffer": true,
"browserify>events": true,
"browserify>process": true,
"browserify>string_decoder": true,
"pumpify>inherits": true,
"readable-stream>util-deprecate": true
}
},
"mocha>serialize-javascript>randombytes": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>process": true,
"koa>content-disposition>safe-buffer": true
}
},
"mockttp>graphql-tag>tslib": {
"globals": {
"define": true
}
},
"nanoid": { "nanoid": {
"globals": { "globals": {
"crypto": true, "crypto": true,
@ -4325,6 +4645,115 @@
"proxyquire>fill-keys>is-object": true "proxyquire>fill-keys>is-object": true
} }
}, },
"react-markdown": {
"globals": {
"console.warn": true
},
"packages": {
"prop-types": true,
"react": true,
"react-markdown>comma-separated-tokens": true,
"react-markdown>property-information": true,
"react-markdown>react-is": true,
"react-markdown>remark-parse": true,
"react-markdown>remark-rehype": true,
"react-markdown>space-separated-tokens": true,
"react-markdown>style-to-object": true,
"react-markdown>unified": true,
"react-markdown>unist-util-visit": true,
"react-markdown>vfile": true
}
},
"react-markdown>property-information": {
"packages": {
"watchify>xtend": true
}
},
"react-markdown>react-is": {
"globals": {
"console": true
}
},
"react-markdown>remark-parse": {
"packages": {
"react-markdown>remark-parse>mdast-util-from-markdown": true
}
},
"react-markdown>remark-parse>mdast-util-from-markdown": {
"packages": {
"react-markdown>remark-parse>mdast-util-from-markdown>mdast-util-to-string": true,
"react-markdown>remark-parse>mdast-util-from-markdown>micromark": true,
"react-markdown>remark-parse>mdast-util-from-markdown>unist-util-stringify-position": true,
"react-syntax-highlighter>refractor>parse-entities": true
}
},
"react-markdown>remark-parse>mdast-util-from-markdown>micromark": {
"packages": {
"react-syntax-highlighter>refractor>parse-entities": true
}
},
"react-markdown>remark-rehype": {
"packages": {
"react-markdown>remark-rehype>mdast-util-to-hast": true
}
},
"react-markdown>remark-rehype>mdast-util-to-hast": {
"globals": {
"console.warn": true
},
"packages": {
"react-markdown>remark-rehype>mdast-util-to-hast>mdast-util-definitions": true,
"react-markdown>remark-rehype>mdast-util-to-hast>mdurl": true,
"react-markdown>remark-rehype>mdast-util-to-hast>unist-builder": true,
"react-markdown>remark-rehype>mdast-util-to-hast>unist-util-generated": true,
"react-markdown>remark-rehype>mdast-util-to-hast>unist-util-position": true,
"react-markdown>unist-util-visit": true
}
},
"react-markdown>remark-rehype>mdast-util-to-hast>mdast-util-definitions": {
"packages": {
"react-markdown>unist-util-visit": true
}
},
"react-markdown>style-to-object": {
"packages": {
"react-markdown>style-to-object>inline-style-parser": true
}
},
"react-markdown>unified": {
"packages": {
"mocha>yargs-unparser>is-plain-obj": true,
"react-markdown>unified>bail": true,
"react-markdown>unified>extend": true,
"react-markdown>unified>is-buffer": true,
"react-markdown>unified>trough": true,
"react-markdown>vfile": true
}
},
"react-markdown>unist-util-visit": {
"packages": {
"react-markdown>unist-util-visit>unist-util-visit-parents": true
}
},
"react-markdown>unist-util-visit>unist-util-visit-parents": {
"packages": {
"react-markdown>unist-util-visit>unist-util-is": true
}
},
"react-markdown>vfile": {
"packages": {
"browserify>path-browserify": true,
"browserify>process": true,
"react-markdown>vfile>is-buffer": true,
"react-markdown>vfile>vfile-message": true,
"vinyl>replace-ext": true
}
},
"react-markdown>vfile>vfile-message": {
"packages": {
"react-markdown>vfile>unist-util-stringify-position": true
}
},
"react-popper": { "react-popper": {
"globals": { "globals": {
"document": true "document": true
@ -4479,6 +4908,11 @@
"react": true "react": true
} }
}, },
"react-syntax-highlighter>refractor>parse-entities": {
"globals": {
"document.createElement": true
}
},
"react-tippy": { "react-tippy": {
"globals": { "globals": {
"Element": true, "Element": true,
@ -4643,20 +5077,20 @@
"define": true "define": true
} }
}, },
"terser>source-map-support>buffer-from": {
"packages": {
"browserify>buffer": true
}
},
"uuid": { "uuid": {
"globals": { "globals": {
"crypto": true, "crypto": true,
"msCrypto": true "msCrypto": true
} }
}, },
"vinyl>clone": { "vinyl>replace-ext": {
"packages": { "packages": {
"browserify>buffer": true "browserify>path-browserify": true
}
},
"wait-on>rxjs>tslib": {
"globals": {
"define": true
} }
}, },
"web3": { "web3": {

View File

@ -257,18 +257,18 @@
"@metamask/ppom-validator": "^0.0.1", "@metamask/ppom-validator": "^0.0.1",
"@metamask/providers": "^11.1.0", "@metamask/providers": "^11.1.0",
"@metamask/rate-limit-controller": "^3.0.0", "@metamask/rate-limit-controller": "^3.0.0",
"@metamask/rpc-methods": "^1.0.0", "@metamask/rpc-methods": "^1.0.1",
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.37.2-flask.1", "@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.37.2-flask.1",
"@metamask/safe-event-emitter": "^2.0.0", "@metamask/safe-event-emitter": "^2.0.0",
"@metamask/scure-bip39": "^2.0.3", "@metamask/scure-bip39": "^2.0.3",
"@metamask/signature-controller": "^4.0.1", "@metamask/signature-controller": "^4.0.1",
"@metamask/slip44": "^3.0.0", "@metamask/slip44": "^3.0.0",
"@metamask/smart-transactions-controller": "^3.1.0", "@metamask/smart-transactions-controller": "^3.1.0",
"@metamask/snaps-controllers": "^1.0.0", "@metamask/snaps-controllers": "^1.0.1",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.0-flask.1", "@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.0-flask.1",
"@metamask/snaps-ui": "^1.0.0", "@metamask/snaps-ui": "^1.0.1",
"@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.37.3-flask.1", "@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.37.3-flask.1",
"@metamask/snaps-utils": "^1.0.0", "@metamask/snaps-utils": "^1.0.1",
"@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1", "@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1",
"@metamask/subject-metadata-controller": "^2.0.0", "@metamask/subject-metadata-controller": "^2.0.0",
"@metamask/utils": "^5.0.0", "@metamask/utils": "^5.0.0",

View File

@ -4,6 +4,7 @@ const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers'); const { hideBin } = require('yargs/helpers');
const { runInShell } = require('../../development/lib/run-command'); const { runInShell } = require('../../development/lib/run-command');
const { exitWithError } = require('../../development/lib/exit-with-error'); const { exitWithError } = require('../../development/lib/exit-with-error');
const { loadBuildTypesConfig } = require('../../development/lib/build-type');
const getTestPathsForTestDir = async (testDir) => { const getTestPathsForTestDir = async (testDir) => {
const testFilenames = await fs.readdir(testDir, { withFileTypes: true }); const testFilenames = await fs.readdir(testDir, { withFileTypes: true });
@ -60,6 +61,11 @@ async function main() {
description: `run mv3 specific e2e tests`, description: `run mv3 specific e2e tests`,
type: 'boolean', type: 'boolean',
}) })
.option('build-type', {
description: `Sets the build-type to test for. This may filter out tests.`,
type: 'string',
choices: Object.keys(loadBuildTypesConfig().buildTypes),
})
.option('retries', { .option('retries', {
description: description:
'Set how many times the test should be retried upon failure.', 'Set how many times the test should be retried upon failure.',
@ -69,13 +75,25 @@ async function main() {
.strict() .strict()
.help('help'); .help('help');
const { browser, debug, retries, snaps, mv3 } = argv; const { browser, debug, retries, snaps, mv3, buildType } = argv;
let testPaths; let testPaths;
if (snaps) { if (snaps) {
const testDir = path.join(__dirname, 'snaps'); const testDir = path.join(__dirname, 'snaps');
testPaths = await getTestPathsForTestDir(testDir); testPaths = await getTestPathsForTestDir(testDir);
if (buildType && buildType !== 'flask') {
// These tests should only be ran on Flask for now
const filteredTests = [
'test-snap-manageAccount.spec.js',
'test-snap-rpc.spec.js',
'test-snap-lifecycle.spec.js',
];
testPaths = testPaths.filter((p) =>
filteredTests.every((filteredTest) => !p.endsWith(filteredTest)),
);
}
} else { } else {
const testDir = path.join(__dirname, 'tests'); const testDir = path.join(__dirname, 'tests');
testPaths = [ testPaths = [

View File

@ -141,6 +141,13 @@
"allNftContracts": "object", "allNftContracts": "object",
"allNfts": "object", "allNfts": "object",
"ignoredNfts": "object", "ignoredNfts": "object",
"snapErrors": "object",
"snaps": "object",
"snapStates": "object",
"jobs": "object",
"database": "object",
"lastUpdated": "object",
"notifications": "object",
"accounts": "object", "accounts": "object",
"currentNetworkTxList": "object", "currentNetworkTxList": "object",
"unapprovedDecryptMsgs": "object", "unapprovedDecryptMsgs": "object",

View File

@ -4718,22 +4718,22 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@metamask/rpc-methods@npm:^1.0.0": "@metamask/rpc-methods@npm:^1.0.1":
version: 1.0.0 version: 1.0.1
resolution: "@metamask/rpc-methods@npm:1.0.0" resolution: "@metamask/rpc-methods@npm:1.0.1"
dependencies: dependencies:
"@metamask/browser-passworder": ^4.0.2 "@metamask/browser-passworder": ^4.0.2
"@metamask/key-tree": ^7.1.1 "@metamask/key-tree": ^7.1.1
"@metamask/permission-controller": ^4.0.0 "@metamask/permission-controller": ^4.0.0
"@metamask/snaps-ui": ^1.0.0 "@metamask/snaps-ui": ^1.0.1
"@metamask/snaps-utils": ^1.0.0 "@metamask/snaps-utils": ^1.0.1
"@metamask/types": ^1.1.0 "@metamask/types": ^1.1.0
"@metamask/utils": ^6.0.1 "@metamask/utils": ^6.0.1
"@noble/hashes": ^1.1.3 "@noble/hashes": ^1.1.3
eth-rpc-errors: ^4.0.2 eth-rpc-errors: ^4.0.2
nanoid: ^3.1.31 nanoid: ^3.1.31
superstruct: ^1.0.3 superstruct: ^1.0.3
checksum: 7e5f2900f9a54bcc112d9861eeb461de5a7803fdaa4e1bfee1c1c9f68a659dc42f56a7dbbc4f8147f66927c7192d1b5314cc32ca5d8985b969694582127b8fa8 checksum: 2e88d739780361901820ae6ba683b14898dafaee8bb05b169f6074265a3c2aa60b9f66fdbc5003e65ed656bce3a2090c6f6d1ea800c1ac7f035dfa21adcccddd
languageName: node languageName: node
linkType: hard linkType: hard
@ -4885,19 +4885,19 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@metamask/snaps-controllers@npm:^1.0.0": "@metamask/snaps-controllers@npm:^1.0.1":
version: 1.0.0 version: 1.0.1
resolution: "@metamask/snaps-controllers@npm:1.0.0" resolution: "@metamask/snaps-controllers@npm:1.0.1"
dependencies: dependencies:
"@metamask/approval-controller": ^3.0.0 "@metamask/approval-controller": ^3.0.0
"@metamask/base-controller": ^3.0.0 "@metamask/base-controller": ^3.0.0
"@metamask/object-multiplex": ^1.2.0 "@metamask/object-multiplex": ^1.2.0
"@metamask/permission-controller": ^4.0.0 "@metamask/permission-controller": ^4.0.0
"@metamask/post-message-stream": ^6.1.2 "@metamask/post-message-stream": ^6.1.2
"@metamask/rpc-methods": ^1.0.0 "@metamask/rpc-methods": ^1.0.1
"@metamask/snaps-execution-environments": ^1.0.0 "@metamask/snaps-execution-environments": ^1.0.1
"@metamask/snaps-registry": ^1.2.1 "@metamask/snaps-registry": ^1.2.1
"@metamask/snaps-utils": ^1.0.0 "@metamask/snaps-utils": ^1.0.1
"@metamask/utils": ^6.0.1 "@metamask/utils": ^6.0.1
"@xstate/fsm": ^2.0.0 "@xstate/fsm": ^2.0.0
concat-stream: ^2.0.0 concat-stream: ^2.0.0
@ -4911,7 +4911,7 @@ __metadata:
pump: ^3.0.0 pump: ^3.0.0
readable-web-to-node-stream: ^3.0.2 readable-web-to-node-stream: ^3.0.2
tar-stream: ^2.2.0 tar-stream: ^2.2.0
checksum: f9ab5a5f593d5d0e971e682d3b32758d30e4bb444ba48f2f66dcf662305ed5c38394fadab32c625d9d171025736637c15765e443d01ef6be247ab75875e0e2e5 checksum: 68b779618e97e5b55c4899c08a48230a41bc64b5bc86330f75167396afe65e0f5eefc8db0a70a08866d713144fe02457dd2705e97d600f403c785ebcb5e12ef8
languageName: node languageName: node
linkType: hard linkType: hard
@ -4957,15 +4957,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@metamask/snaps-execution-environments@npm:^1.0.0": "@metamask/snaps-execution-environments@npm:^1.0.1":
version: 1.0.0 version: 1.0.1
resolution: "@metamask/snaps-execution-environments@npm:1.0.0" resolution: "@metamask/snaps-execution-environments@npm:1.0.1"
dependencies: dependencies:
"@metamask/object-multiplex": ^1.2.0 "@metamask/object-multiplex": ^1.2.0
"@metamask/post-message-stream": ^6.1.1 "@metamask/post-message-stream": ^6.1.1
"@metamask/providers": ^10.2.0 "@metamask/providers": ^10.2.0
"@metamask/rpc-methods": ^1.0.0 "@metamask/rpc-methods": ^1.0.1
"@metamask/snaps-utils": ^1.0.0 "@metamask/snaps-utils": ^1.0.1
"@metamask/utils": ^6.0.1 "@metamask/utils": ^6.0.1
eth-rpc-errors: ^4.0.3 eth-rpc-errors: ^4.0.3
json-rpc-engine: ^6.1.0 json-rpc-engine: ^6.1.0
@ -4973,7 +4973,7 @@ __metadata:
ses: ^0.18.1 ses: ^0.18.1
stream-browserify: ^3.0.0 stream-browserify: ^3.0.0
superstruct: ^1.0.3 superstruct: ^1.0.3
checksum: 744af06aab2952da69efa6922eb886a6cdbbec0368b35d3d253ecedcc940001e08b2496aa87acfbfe88d7e38955c8e807e942a4c86fc6c01ed86ce44f2106180 checksum: 69a7d94c3d9b4838f72330bb7956c1bf27eb856d481d66669ac2461294e1e8491108385b510a83ff02edb08eca3236889ef74482a3eaefc6e8bc540b3f7880c0
languageName: node languageName: node
linkType: hard linkType: hard
@ -5018,13 +5018,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@metamask/snaps-ui@npm:^1.0.0": "@metamask/snaps-ui@npm:^1.0.1":
version: 1.0.0 version: 1.0.1
resolution: "@metamask/snaps-ui@npm:1.0.0" resolution: "@metamask/snaps-ui@npm:1.0.1"
dependencies: dependencies:
"@metamask/utils": ^6.0.1 "@metamask/utils": ^6.0.1
superstruct: ^1.0.3 superstruct: ^1.0.3
checksum: 805d23c43eb9a5d7ed7d332c9f98187b755142aeb37129d29a5153d2c9bd995beb5508a4d7f26b9d958d403768decded133d8b0c9935d3ac691f6e26fa81c285 checksum: c3eb4808ffeb94b4d7a7f52b5827ee866ebf488c2abab8599f1f002f85eb5b39d1e2ca639258f75e8b9cc850f969bddbdb2de5c491a8d4d7f3912de8ad26ec27
languageName: node languageName: node
linkType: hard linkType: hard
@ -5117,9 +5117,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@metamask/snaps-utils@npm:^1.0.0": "@metamask/snaps-utils@npm:^1.0.1":
version: 1.0.0 version: 1.0.1
resolution: "@metamask/snaps-utils@npm:1.0.0" resolution: "@metamask/snaps-utils@npm:1.0.1"
dependencies: dependencies:
"@babel/core": ^7.18.6 "@babel/core": ^7.18.6
"@babel/types": ^7.18.7 "@babel/types": ^7.18.7
@ -5128,7 +5128,7 @@ __metadata:
"@metamask/permission-controller": ^4.0.0 "@metamask/permission-controller": ^4.0.0
"@metamask/providers": ^10.2.1 "@metamask/providers": ^10.2.1
"@metamask/snaps-registry": ^1.2.1 "@metamask/snaps-registry": ^1.2.1
"@metamask/snaps-ui": ^1.0.0 "@metamask/snaps-ui": ^1.0.1
"@metamask/utils": ^6.0.1 "@metamask/utils": ^6.0.1
"@noble/hashes": ^1.1.3 "@noble/hashes": ^1.1.3
"@scure/base": ^1.1.1 "@scure/base": ^1.1.1
@ -5141,7 +5141,7 @@ __metadata:
ses: ^0.18.7 ses: ^0.18.7
superstruct: ^1.0.3 superstruct: ^1.0.3
validate-npm-package-name: ^5.0.0 validate-npm-package-name: ^5.0.0
checksum: daf2ff95c7fbd3c68ef47b3816aba9fbbe7363adc780500fe03b3b0b0ba23ca382e16feeb6deb909d458e08c035214e5819a48d8f7456499934299224f980b8f checksum: 45ef36809b41c71b79bd49c19450efdb999c5b738ce0989b6880ae117b172d44519967334ade650ae6239c5068e71c019e096f6ac6155aa23bb26d98fe5294af
languageName: node languageName: node
linkType: hard linkType: hard
@ -24756,18 +24756,18 @@ __metadata:
"@metamask/ppom-validator": ^0.0.1 "@metamask/ppom-validator": ^0.0.1
"@metamask/providers": ^11.1.0 "@metamask/providers": ^11.1.0
"@metamask/rate-limit-controller": ^3.0.0 "@metamask/rate-limit-controller": ^3.0.0
"@metamask/rpc-methods": ^1.0.0 "@metamask/rpc-methods": ^1.0.1
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.37.2-flask.1" "@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.37.2-flask.1"
"@metamask/safe-event-emitter": ^2.0.0 "@metamask/safe-event-emitter": ^2.0.0
"@metamask/scure-bip39": ^2.0.3 "@metamask/scure-bip39": ^2.0.3
"@metamask/signature-controller": ^4.0.1 "@metamask/signature-controller": ^4.0.1
"@metamask/slip44": ^3.0.0 "@metamask/slip44": ^3.0.0
"@metamask/smart-transactions-controller": ^3.1.0 "@metamask/smart-transactions-controller": ^3.1.0
"@metamask/snaps-controllers": ^1.0.0 "@metamask/snaps-controllers": ^1.0.1
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.0-flask.1" "@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.0-flask.1"
"@metamask/snaps-ui": ^1.0.0 "@metamask/snaps-ui": ^1.0.1
"@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.37.3-flask.1" "@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.37.3-flask.1"
"@metamask/snaps-utils": ^1.0.0 "@metamask/snaps-utils": ^1.0.1
"@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1" "@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1"
"@metamask/subject-metadata-controller": ^2.0.0 "@metamask/subject-metadata-controller": ^2.0.0
"@metamask/test-dapp": ^7.0.1 "@metamask/test-dapp": ^7.0.1