-
Notifications
You must be signed in to change notification settings - Fork 9.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
misc(scripts): more useful lantern debugging output #5517
Conversation
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.
didn't look closely, but i dont want to block ya
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.
LGTM, just some comments on tsc stuff.
Directions for these various scripts would probably be good to add at some point :)
const constants = require('./constants'); | ||
|
||
// @ts-ignore | ||
const chalk = require('chalk'); |
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.
chalk isn't in our deps, is that on purpose? (chalk also added its own types at some point, it looks like, though our transitive dep chalk is stuck on an old version)
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.
yeah mostly didn't want to bulk it up, but you prefer I add it? I can depend a newer one with types.
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.
done
const computedResults = require(HEAD_PATH); | ||
const expectedResults = require(MASTER_PATH); | ||
|
||
/** @type {{url: string, maxDiff: number, diffsForSite: DiffForSite[]}[]} */ |
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.
this seems like a case for old-fashioned Array<>
, at least in the surrounding block :)
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.
heh, alright done :)
/** @type {{url: string, maxDiff: number, diffsForSite: DiffForSite[]}[]} */ | ||
const diffs = []; | ||
for (const entry of computedResults.sites) { | ||
// @ts-ignore - should always exist |
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.
what should always exist?
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.
fixed
fs.unlinkSync(TMP_HEAD_PATH); | ||
fs.unlinkSync(TMP_MASTER_PATH); | ||
const computedResults = require(HEAD_PATH); | ||
const expectedResults = require(MASTER_PATH); |
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.
since master is constant, would it be better to require it directly so the compiler can pick it up?
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 don't think so unless I'm misunderstanding. TS just seems to put on a compiler error on the JSON for not being a module and then we have to copy/paste the path around...?
const RUN_ONCE_PATH = path.join(__dirname, 'run-once.js'); | ||
|
||
const siteIndex = require(SITE_INDEX_PATH); | ||
// @ts-ignore |
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.
whats being ignored?
so lantern tests have been great canary but not all that helpful for debugging :) the git diff didn't always include the URL you needed to look at, it included a lot of lines that weren't relevant, and didn't give clear priority to the most affected URLs
this makes a few tweaks and adds a debug script
new output of the
assert-*
script: