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

testing matrix #3

Merged
merged 33 commits into from
Dec 3, 2024
Merged

testing matrix #3

merged 33 commits into from
Dec 3, 2024

Conversation

Ethan-Arrowood
Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood commented Nov 21, 2024

Big PR, check out the CONTRIBUTING.md file for more info on the new test runner.

High level:

  • Uses containers to isolate a Node.js, HarperDB, and Next.js deployment
  • Uses Playwright to actually test the Next.js apps
  • Try's its best to not overwhelm system resources by keeping parallelization to a minimum (room to go faster later).

@Ethan-Arrowood
Copy link
Contributor Author

Putting this here so I don't lose it.

During development, I'm seeing some slight flake already particularly with Next 15 and Node 18. When I run npm run test back-to-back, the first one succeeds, and then the second one fails with:

npm run test

> @harperdb/[email protected] test
> node --test

ctx: {
  fixture: Fixture {
    nextMajor: '15',
    nodeMajor: '18',
    debug: false,
    imageName: 'hdb-next-integration-test-image-next-15-node-18',
    containerName: 'hdb-next-integration-test-container-next-15-node-18',
    ready: Promise {
      undefined,
      [Symbol(async_id_symbol)]: 77,
      [Symbol(trigger_async_id_symbol)]: 76
    }
  },
  rest: 'http://0.0.0.0:38081'
}
▶ Next.js v15 - Node.js v18
  ✖ should run base component (202.76925ms)
    TypeError [Error]: fetch failed
        at node:internal/deps/undici/undici:13392:13
        at async TestContext.<anonymous> (file:///Users/ethan/dev/harperdb/nextjs/test/next-15-node-18.test.js:17:20)
        at async Test.run (node:internal/test_runner/test:935:9)
        at async Promise.all (index 0)
        at async Suite.run (node:internal/test_runner/test:1320:7)
        at async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3) {
      [cause]: Error [SocketError]: other side closed
          at Socket.<anonymous> (node:internal/deps/undici/undici:6238:28)
          at Socket.emit (node:events:530:35)
          at endReadableNT (node:internal/streams/readable:1698:12)
          at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
        code: 'UND_ERR_SOCKET',
        socket: { localAddress: '127.0.0.1', localPort: 62968, remoteAddress: '127.0.0.1', remotePort: 38081, remoteFamily: 'IPv4', timeout: undefined, bytesWritten: 252, bytesRead: 0 }
      }
    }

✖ Next.js v15 - Node.js v18 (7151.077416ms)
▶ Next.js v15 - Node.js v20
  ✔ should run base component (20.143333ms)
✔ Next.js v15 - Node.js v20 (7520.460583ms)
▶ Next.js v15 - Node.js v22
  ✔ should run base component (20.061916ms)
✔ Next.js v15 - Node.js v22 (7639.554125ms)
ℹ tests 3
ℹ suites 3
ℹ pass 2
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 8222.458958

✖ failing tests:

test at test/next-15-node-18.test.js:16:8
✖ should run base component (202.76925ms)
  TypeError [Error]: fetch failed
      at node:internal/deps/undici/undici:13392:13
      at async TestContext.<anonymous> (file:///Users/ethan/dev/harperdb/nextjs/test/next-15-node-18.test.js:17:20)
      at async Test.run (node:internal/test_runner/test:935:9)
      at async Promise.all (index 0)
      at async Suite.run (node:internal/test_runner/test:1320:7)
      at async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3) {
    [cause]: Error [SocketError]: other side closed
        at Socket.<anonymous> (node:internal/deps/undici/undici:6238:28)
        at Socket.emit (node:events:530:35)
        at endReadableNT (node:internal/streams/readable:1698:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      code: 'UND_ERR_SOCKET',
      socket: { localAddress: '127.0.0.1', localPort: 62968, remoteAddress: '127.0.0.1', remotePort: 38081, remoteFamily: 'IPv4', timeout: undefined, bytesWritten: 252, bytesRead: 0 }
    }
  }

I'm not really sure how to debug this. It only seems to trigger with Node 18, so maybe its a issue in Node? Next.js 15 should work fine with Node 18. And this really only happens when executed back-to-back quickly.

@Ethan-Arrowood Ethan-Arrowood marked this pull request as ready for review December 3, 2024 00:41
Copy link
Member

@kriszyp kriszyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, nice work!

Copy link
Member

@BboyAkers BboyAkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 🔥 🔥 🔥

Copy link

@Devin-Holland Devin-Holland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed from a workflow standpoint. Looks good.

@Ethan-Arrowood Ethan-Arrowood merged commit 5519499 into main Dec 3, 2024
1 check passed
@Ethan-Arrowood Ethan-Arrowood deleted the test-matrix branch December 3, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants