-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ci: enhance our test environment setup #4291
base: master
Are you sure you want to change the base?
Conversation
ERROR: util.isRegExp is not a function
TypeError: util.isRegExp is not a function
at merge (/home/runner/work/less.js/less.js/packages/less/node_modules/clean-css/lib/utils/compatibility.js:122:44)
at Compatibility.toOptions (/home/runner/work/less.js/less.js/packages/less/node_modules/clean-css/lib/utils/compatibility.js:159:10)
at new CleanCSS (/home/runner/work/less.js/less.js/packages/less/node_modules/clean-css/lib/clean.js:44:61)
at CleanCSSProcessor.process (/home/runner/work/less.js/less.js/packages/less/node_modules/less-plugin-clean-css/lib/clean-css-processor.js:40:26) |
Error: Command failed: node test/browser/generator/runner.js
/home/runner/work/less.js/less.js/packages/less/node_modules/puppeteer-core/lib/cjs/puppeteer/util/disposable.js:9
Symbol.dispose ??= Symbol('dispose'); node <= 14 not support |
@matthew-dean @puckowski any suggestion ? |
Thank you for putting this together. I am fine with updating clean-css at a later time (current version used by Less.js is fairly old) and adding Node 23 support at a later time. I can help test and contribute a PR for that. I am also fine with dropping Node versions no longer is maintenance. Disappointing about Windows-2022. I'll take a look at the Puppeteer repository and see what the plans are, if any, for serial testing. PR diff seems reasonable to me. |
I don't want to derail this, but in the meantime since using Puppeteer, I think Playwright has gotten much more mature. @iChenLei Does Puppeteer have the support limitations you list? If not, I think we should switch to that. |
Ok, let me try |
Run npx playwright install chromium
npx: installed 2 in 1.[4](https://github.com/less/less.js/actions/runs/12219190415/job/34085524282?pr=4291#step:6:5)01s
You are running Node.js 12.22.12.
Playwright requires Node.js 14 or higher.
Please update your version of Node.js. |
@puckowski @matthew-dean Please review, thanks.
|
I will try to review PR sometime today (12/08/24). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 14, 16, 18, 20, and 22 support is great. The dependency logic makes sense to me.
I am glad you got macos-latest
and windows-latest
to work.
Allowing Node 23 to fail will be a good reminder that we need to work on it.
I left a couple of non-blocking comments (can be addressed later if CI becomes flaky), but overall this PR looks good to me!
function handleConsole(msg) { | ||
const args = msg.args() || []; | ||
|
||
Promise.all(args.map(a => a.jsonValue().catch(() => ''))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think omitting more robust error handling for every possible exception in this script is okay because YAGNI (You Aren't Gonna Need It), though I think in think case we should try to expand a little bit on why args
failed to map to a JSON value.
Maybe something like:
args.map(a =>
a.jsonValue().catch(error => {
console.warn("Failed to retrieve JSON value from argument:", error);
return '';
})
)
|
||
return page.addInitScript(initMocha, reporter) | ||
.then(() => page.goto(url)) | ||
.then(() => page.waitForFunction(() => window.__mochaResult__, { timeout, polling })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible __mochaResult__
may not be defined after timeout? May want to improve error handling in that scenario so we have a clear message as to why CI failed.
Maybe something like:
.then(result => {
if (!result) {
throw new Error('Mocha results not found after waiting. The tests may not have run correctly.');
}
// Close browser before resolving result
return browser.close().then(() => result);
});
What does this PR do?
v14
due to Playwright requirements, removing tests for v10 and v12. This is an improvement over Puppeteer, which requires a minimum ofv16
.Checklist:
Previous PR desc
What does this PR do?
Conclusion:
Removed tests for Node.js (10, 12, 14) as these versions have reached end-of-life. Used Windows-2019 for Windows support due to known issues. Node 23 tests were not added because of the failing less-plugin-clean-css test.
Checklist: