Skip to content

Rewrite tests in Puppeteer#5

Merged
savetheclocktower merged 3 commits into
masterfrom
rewrite-tests-in-puppeteer
May 31, 2026
Merged

Rewrite tests in Puppeteer#5
savetheclocktower merged 3 commits into
masterfrom
rewrite-tests-in-puppeteer

Conversation

@savetheclocktower
Copy link
Copy Markdown

Running npm test succeeds on my machine, but fails in CI because ubuntu-latest uses an OpenSSL that is too new for an abandoned project like PhantomJS. Luckily, Claude is good at rewriting stuff in new stuff, so I had it take a pass and then fixed a couple things that were broken.

This can possibly be fixed in the short term by pinning to ubuntu-20.04, but that will only kick the can down the road.

I've verified that this does what we expect, and that I can make a test fail by going into the relevant file and changing the spec expectation (so it's not just passing a bunch of tests by default).

@savetheclocktower
Copy link
Copy Markdown
Author

OK, I think this is the way forward.

Pinning to ubuntu20.04 does not appear feasible; I tried it on master just to get a release published, but the release workflow was triggered 28 minutes ago and is still queued and waiting for a runner.

Copy link
Copy Markdown
Member

@DeeDeeG DeeDeeG left a comment

Choose a reason for hiding this comment

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

abandoned project like PhantomJS

Sad but true. I can see why a PR such as this is necessary.

As long as the tests pass without changing the logic of the tests themselves, as appears to be the case from looking at all the CI jobs for this PR, this looks fine to me!

@DeeDeeG
Copy link
Copy Markdown
Member

DeeDeeG commented May 31, 2026

This can possibly be fixed in the short term by pinning to ubuntu-20.04

Pinning to ubuntu20.04 does not appear feasible; I tried it on master just to get a release published, but the release workflow was triggered 28 minutes ago and is still queued and waiting for a runner.

Pinning to windows-latest would apparently have been enough to get the "publish to NPM" workflow to pass! 😄

but that will only kick the can down the road.

All too true, once again.

@savetheclocktower savetheclocktower force-pushed the rewrite-tests-in-puppeteer branch from 2ba980f to 8809c24 Compare May 31, 2026 22:47
@savetheclocktower savetheclocktower merged commit b7749c8 into master May 31, 2026
6 checks passed
@savetheclocktower savetheclocktower deleted the rewrite-tests-in-puppeteer branch May 31, 2026 22:50
@DeeDeeG
Copy link
Copy Markdown
Member

DeeDeeG commented May 31, 2026

Luckily, Claude is good at rewriting stuff in new stuff, so I had it take a pass and then fixed a couple things that were broken.

I initially skimmed the explanation and missed that Claude did the first pass of this, but

I've verified that this does what we expect, and that I can make a test fail by going into the relevant file and changing the spec expectation (so it's not just passing a bunch of tests by default).

This is the crucial part as far as I'm concerned, and what I was looking for by reading the CI jobs' test step outputs, I'm glad you went further and tried breaking some tests to confirm they would actually show as failed, just to be sure, given AI's ability to be wrong plenty of the time. But yeah, the resulting code looks reasonable and not more complex than the PhantomJS version, so. Seems fine even knowing Claude did the first pass.

It's honestly kind of wild how far AI coding tools have come, probably further than most of the generative stuff, but even stuff like photo generation is getting annoyingly close to fully believable, hard to detect right away. (At least the stuff that falls on the more believable end.) That's a tangent for another time, though, I guess.

@DeeDeeG
Copy link
Copy Markdown
Member

DeeDeeG commented May 31, 2026

Noting my results before locally:

total: 41 blocks (93 single tests)

(Same results "before" this PR, in #4's CI: https://github.com/pulsar-edit/document-register-element/actions/runs/26725047579/job/78762282243)

vs after this PR (CI):

total: 41 blocks (96 individual tests)

Hmmm, three new individual tests?


Also, I think this Chromium might be too new for my aging macOS Catalina locally? :|

% npm test                   

> @pulsar-edit/document-register-element@1.15.3 test
> node testrunner.js

/Users/USER/document-register-element/node_modules/@puppeteer/browsers/lib/cjs/launch.js:350
                reject(new Error([
                       ^

Error: Failed to launch the browser process:  Code: null

stderr:
dlopen /Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/../Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework: dlopen(/Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/../Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework, 261): Library not loaded: /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio
  Referenced from: /Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework
  Reason: image not found.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

    at ChildProcess.onClose (/Users/USER/document-register-element/node_modules/@puppeteer/browsers/lib/cjs/launch.js:350:24)
    at ChildProcess.emit (node:events:536:35)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

Node.js v20.20.2

https://developer.apple.com/documentation/avfaudio

macOS 11.3+

Yep!

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.

2 participants