ipfs-webui icon indicating copy to clipboard operation
ipfs-webui copied to clipboard

Fix end-to-end tests under js-ipfs

Open lidel opened this issue 4 years ago • 6 comments

Extracted from https://github.com/ipfs/ipfs-webui/pull/1713

Right now e2e tests do not pass against js-ipfs:

npm ci && npm run build && E2E_IPFSD_TYPE=js npm run test:e2e

Note: we are unable to ship webui with js-ipfs without fixing this. In theory, it is ok to ship release that only works with go-ipfs and fix this later, using tribute rotation, but would be way better to ship release to both JS and GO.

lidel avatar Mar 25 '21 23:03 lidel

For reference:

(node:22646) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 FAIL  test/e2e/navigation.test.js
  Navigation menu
    ✓ should work for Status page (152 ms)
    ✓ should work for Files page (246 ms)
    ✕ should work for Explore page (16 ms)
    ✓ should work for Peers page (373 ms)
    ✓ should work for Settings page (434 ms)

  ● Navigation menu › should work for Explore page





  console.error
    Unhandled error

      at process.uncaught (../../node_modules/jest-config/node_modules/jest-jasmine2/build/jasmine/Env.js:248:21)
      at processEmit [as emit] (../../node_modules/signal-exit/index.js:161:32)
      at handleError (../../node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:17:11)
      at ../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:75
          at Array.map (<anonymous>)
      at Object.emit (../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:56)

  console.error
    

      at process.uncaught (../../node_modules/jest-config/node_modules/jest-jasmine2/build/jasmine/Env.js:249:21)
      at processEmit [as emit] (../../node_modules/signal-exit/index.js:161:32)
      at handleError (../../node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:17:11)
      at ../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:75
          at Array.map (<anonymous>)
      at Object.emit (../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:56)

 PASS  test/e2e/files.test.js
  Files screen
    ✓ should have the active Add menu (245 ms)
    ✓ should allow for a successful import of two files (497 ms)

 PASS  test/e2e/explore.test.js
  Explore screen
    ✓ should have Project Apollo Archive as one of examples (71 ms)
    ✓ should open arbitrary CID (534 ms)

 PASS  test/e2e/status.test.js
  Status page
    ✓ should have Status menu item (21 ms)
    ✓ should inform it is sucessfully connected to IPFS (22 ms)
    ✓ should display Peer ID of real IPFS node (27 ms)

  console.error
    Unhandled error

      at process.uncaught (../../node_modules/jest-config/node_modules/jest-jasmine2/build/jasmine/Env.js:248:21)
      at processEmit [as emit] (../../node_modules/signal-exit/index.js:161:32)
      at handleError (../../node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:17:11)
      at ../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:75
          at Array.map (<anonymous>)
      at Object.emit (../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:56)

  console.error
    

      at process.uncaught (../../node_modules/jest-config/node_modules/jest-jasmine2/build/jasmine/Env.js:249:21)
      at processEmit [as emit] (../../node_modules/signal-exit/index.js:161:32)
      at handleError (../../node_modules/jest-environment-puppeteer/lib/PuppeteerEnvironment.js:17:11)
      at ../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:75
          at Array.map (<anonymous>)
      at Object.emit (../../node_modules/puppeteer/vendor/mitt/src/index.ts:81:56)

 PASS  test/e2e/settings.test.js
  Settings screen
    ✓ should show config of IPFS node (83 ms)

 PASS  test/e2e/peers.test.js (14.634 s)
  Peers screen
    ✓ should have a clickable "Add connection" button (216 ms)
    ✓ should confirm connection after "Add connection"  (1345 ms)
    ✓ should have a peer from a "Local Network" (10212 ms)

Test Suites: 2 failed, 5 passed, 7 total
Tests:       6 failed, 20 passed, 26 total
Snapshots:   0 total
Time:        48.063 s, estimated 83 s
Ran all test suites.

lidel avatar Mar 25 '21 23:03 lidel

GO tests seem to be flaky now too :( https://app.circleci.com/pipelines/github/ipfs/ipfs-webui/830/workflows/e38bc1d3-f5e4-4576-acb7-b9c8417b9fb6/jobs/4936

Might be Travis. Try slowing down/bumping timeouts.

lidel avatar Mar 26 '21 00:03 lidel

@lidel : I know I don't have the full context here, but I don't want fixing tests to be optional. If we need help here from Go folks, lets call it out (and at the latest at the next Triage session). Basically, I'm worried about this being at P3.

BigLep avatar Apr 01 '21 03:04 BigLep

@BigLep I agree that e2e tests should not be optional.

Filled as P3 because initially the issue was limited to js-ipfs interop (which we dont use in ipfs-desktop, so low priority), but since then I confirmed flaky tests occur for go-ipfs sometimes, so bumping to P1.

Puppeteer (tool used for e2e test orchestration in real browser) has been getting buggier with each release, seems to be effectively deprecated for a while. We planned to move to playwright (more modern replacement), but our GUI team got dissolved and here we are today.

I don't think it's productive to spend time on fixing puppeteer. We've already spent too much time on it. Switching to playwright should fix flakiness – could be a task for a tribute familiar with JS ecosystem.

lidel avatar Apr 01 '21 13:04 lidel

@lidel : sounds good. Is the switch to Playwright something we should ask our "IP JS" tribute to do, or does it require someone with more browser experience? Either way, I assume we'll need a tracking task for this work and that this issue (#1737) will be dependent on?

BigLep avatar Apr 01 '21 21:04 BigLep

  • Any JS person with some frontend exp could work on that. I'll file an issue after we finish webui work for the v2.12 milestone and the problem is still there.
  • Note to self: some of js-ipfs regressions may be related to https://github.com/ipfs/js-ipfs/issues/3289

lidel avatar Apr 03 '21 00:04 lidel

wontfix. we're decoupling from js-ipfs

SgtPooki avatar Dec 05 '22 21:12 SgtPooki