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

Restore test harness on CI #1556

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions bin/run-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,31 @@ const browser = await puppeteer.launch({

console.log('[ci] puppeteer launched');

await /** @type {Promise<void>} */ (
// eslint-disable-next-line no-async-promise-executor
new Promise(async (fulfill) => {
const page = await browser.newPage();

page.on('console', (msg) => {
const location = msg.location();
const text = msg.text();

if (location.url?.includes(`/qunit.js`)) {
console.log(text);
} else if (text === `[HARNESS] done`) {
fulfill();
}
});

await page.goto('http://localhost:60173?hidepassed&ci');
})
);
try {
await /** @type {Promise<void>} */ (
new Promise(async (fulfill, reject) => {
const page = await browser.newPage();

page.on('console', (msg) => {
const location = msg.location();
const text = msg.text();

if (location.url?.includes(`/qunit.js`)) {
console.log(text);
} else if (text === `[HARNESS] done`) {
fulfill();
} else if (text === `[HARNESS] fail`) {
reject();
}
});

await page.goto('http://localhost:60173?hidepassed&ci');
})
);
} catch {
await browser.close();
process.exit(1);
}

await browser.close();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ export async function setupQunit() {
qunit.moduleDone(pause);
}

qunit.done(() => {
console.log('[HARNESS] done');
qunit.done(({ failed }) => {
if (failed > 0) {
console.log('[HARNESS] fail');
} else {
console.log('[HARNESS] done');
}
});

return {
Expand Down
12 changes: 6 additions & 6 deletions packages/@glimmer/validator/lib/validators.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@ class MonomorphicTagImpl<T extends MonomorphicTagId = MonomorphicTagId> {

if (subtag !== null) {
if (Array.isArray(subtag)) {
revision = subtag.reduce((prev, currentTag: Tag) => {
let current = currentTag[COMPUTE]();
return current > prev ? current : prev;
}, revision);
for (const tag of subtag) {
let value = tag[COMPUTE]();
revision = Math.max(value, revision);
}
} else {
let subtagValue = subtag[COMPUTE]();

if (subtagValue === this.subtagBufferCache) {
revision = revision > this.lastValue ? revision : this.lastValue;
revision = Math.max(revision, this.lastValue);
} else {
// Clear the temporary buffer cache
this.subtagBufferCache = null;
revision = revision > subtagValue ? revision : subtagValue;
revision = Math.max(revision, subtagValue);
}
}
}
Expand Down
Loading