Commit b1257bd
test: add
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR implements a localserver for the
`snap-account-abstraction-keyring-site` instead of going to the live
site, in our e2e, to avoid flakiness. This implies the following:
- Removing all related live requests from the allowlist
- Adding the `snap-account-abstraction-keyring-site` as an npm package
- Updating the snap simple keyring binaries, as the version was updated
to 1.0.0 . The changes are just the result of running this yarn
update-snap-binary --snap-account-abstraction-keyring@1.0.0
- In our tests, we are not going to localhost directly, as localhost is
not in the allowlist for that snap. So we take the same approach as we
did before, suggested by @FrederikBolding , where we proxy the
localhost, so we still see the origin as metamask.github so then we
don't get errors, and we avoid adding localhost in the allowlist (this
was a small security concern). Context:
https://consensys.slack.com/archives/GN3SR3GNM/p1759489395046839
Usage in our e2e:
```javascript
await withFixtures(
{
dapp: true,
dappPaths: ['snap-account-abstraction-keyring-site'],
...
```
- Related work: [test: add snap-simple-keyring-site as a local server
and remove live requests to the
site](#36557)
- Snap Account Abstraction Keyring Release PR:
MetaMask/snap-account-abstraction-keyring#216
[](https://codespaces.new/MetaMask/metamask-extension/pull/36801?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-428
## **Manual testing steps**
1. Check ci
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> E2E tests now use a locally served
`@metamask/snap-account-abstraction-keyring-site` with new mocks,
removing live site requests and updating related configs and
dependencies (including ethers 5.8).
>
> - **E2E/Testing**:
> - Serve `@metamask/snap-account-abstraction-keyring-site` locally via
`dappPaths` and new mock proxy
(`account-abstraction-keyring-site-mocks.ts`).
> - Replace snap mocks import; install flow updated to wait for dialog
close; integrate site and swaps mocks together.
> - Remove live site URLs from `test/e2e/mock-e2e-allowlist.js`.
> - **Config/Tooling**:
> - Add `@metamask/snap-account-abstraction-keyring-site` to
`package.json` and `.depcheckrc.yml` ignore list.
> - Update snap binary headers for
`snap-account-abstraction-keyring@1.0.0`.
> - Extend test helper to resolve local site path.
> - **Security Policy**:
> - Adjust LavaMoat Browserify/Webpack policies to reference `ethers`
subpackages consistently (switch to `ethers>@ethersproject/*`).
> - **Dependencies**:
> - Bump `ethers` and all `@ethersproject/*` to `5.8.0`; update `ws`,
`elliptic` accordingly.
> - Refresh MetaMask packages (`json-rpc-engine`,
`json-rpc-middleware-stream`, add legacy `providers` for site) and add
site-related packages.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bc72af3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>snap-account-abstraction-keyring-site as a local server and remove live requests to the site (#36801)1 parent e1958ff commit b1257bd
File tree
15 files changed
+655
-681
lines changed- lavamoat
- browserify
- beta
- experimental
- flask
- main
- webpack
- test/e2e
- flask
- mock-response-data/snaps
- snap-binaries-and-headers
- snap-local-sites
15 files changed
+655
-681
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 198 | + | |
209 | 199 | | |
210 | 200 | | |
211 | 201 | | |
| |||
224 | 214 | | |
225 | 215 | | |
226 | 216 | | |
227 | | - | |
| 217 | + | |
228 | 218 | | |
229 | 219 | | |
230 | 220 | | |
| |||
235 | 225 | | |
236 | 226 | | |
237 | 227 | | |
238 | | - | |
239 | | - | |
| 228 | + | |
| 229 | + | |
240 | 230 | | |
241 | 231 | | |
242 | 232 | | |
| |||
246 | 236 | | |
247 | 237 | | |
248 | 238 | | |
249 | | - | |
| 239 | + | |
250 | 240 | | |
251 | 241 | | |
252 | 242 | | |
| |||
261 | 251 | | |
262 | 252 | | |
263 | 253 | | |
264 | | - | |
265 | | - | |
| 254 | + | |
| 255 | + | |
266 | 256 | | |
267 | 257 | | |
268 | 258 | | |
| |||
272 | 262 | | |
273 | 263 | | |
274 | 264 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | 265 | | |
282 | 266 | | |
283 | | - | |
| 267 | + | |
284 | 268 | | |
285 | 269 | | |
286 | 270 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | 271 | | |
303 | 272 | | |
304 | 273 | | |
305 | 274 | | |
306 | 275 | | |
307 | 276 | | |
308 | 277 | | |
309 | | - | |
| 278 | + | |
310 | 279 | | |
311 | 280 | | |
312 | 281 | | |
| |||
317 | 286 | | |
318 | 287 | | |
319 | 288 | | |
320 | | - | |
| 289 | + | |
321 | 290 | | |
322 | 291 | | |
323 | 292 | | |
| |||
340 | 309 | | |
341 | 310 | | |
342 | 311 | | |
343 | | - | |
| 312 | + | |
344 | 313 | | |
345 | 314 | | |
346 | 315 | | |
| |||
357 | 326 | | |
358 | 327 | | |
359 | 328 | | |
360 | | - | |
| 329 | + | |
361 | 330 | | |
362 | 331 | | |
363 | 332 | | |
364 | 333 | | |
365 | 334 | | |
366 | | - | |
| 335 | + | |
367 | 336 | | |
368 | 337 | | |
369 | 338 | | |
370 | 339 | | |
371 | 340 | | |
372 | | - | |
| 341 | + | |
373 | 342 | | |
374 | 343 | | |
375 | 344 | | |
376 | 345 | | |
377 | 346 | | |
378 | 347 | | |
379 | | - | |
| 348 | + | |
380 | 349 | | |
381 | 350 | | |
382 | 351 | | |
| |||
385 | 354 | | |
386 | 355 | | |
387 | 356 | | |
388 | | - | |
389 | | - | |
| 357 | + | |
| 358 | + | |
390 | 359 | | |
391 | 360 | | |
392 | 361 | | |
| |||
395 | 364 | | |
396 | 365 | | |
397 | 366 | | |
398 | | - | |
| 367 | + | |
399 | 368 | | |
400 | 369 | | |
401 | 370 | | |
| |||
404 | 373 | | |
405 | 374 | | |
406 | 375 | | |
407 | | - | |
408 | | - | |
| 376 | + | |
| 377 | + | |
409 | 378 | | |
410 | 379 | | |
411 | 380 | | |
| |||
414 | 383 | | |
415 | 384 | | |
416 | 385 | | |
417 | | - | |
| 386 | + | |
418 | 387 | | |
419 | 388 | | |
420 | 389 | | |
| |||
426 | 395 | | |
427 | 396 | | |
428 | 397 | | |
429 | | - | |
430 | | - | |
| 398 | + | |
| 399 | + | |
431 | 400 | | |
432 | 401 | | |
433 | 402 | | |
| |||
443 | 412 | | |
444 | 413 | | |
445 | 414 | | |
446 | | - | |
| 415 | + | |
447 | 416 | | |
448 | 417 | | |
449 | 418 | | |
| |||
452 | 421 | | |
453 | 422 | | |
454 | 423 | | |
455 | | - | |
| 424 | + | |
456 | 425 | | |
457 | 426 | | |
458 | 427 | | |
| |||
1900 | 1869 | | |
1901 | 1870 | | |
1902 | 1871 | | |
1903 | | - | |
| 1872 | + | |
1904 | 1873 | | |
1905 | 1874 | | |
1906 | 1875 | | |
| |||
3468 | 3437 | | |
3469 | 3438 | | |
3470 | 3439 | | |
3471 | | - | |
| 3440 | + | |
3472 | 3441 | | |
3473 | 3442 | | |
3474 | 3443 | | |
| |||
0 commit comments