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

feat(cli): add --lhr to assert command to load LHRs from anywhere #1024

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

connorjclark
Copy link
Collaborator

ref GoogleChrome/lighthouse#15203

Enables usage like this:

node packages/cli/src/cli.js -no-lighthouserc assert \
  --lhr /Users/cjamcl/src/lighthouse/core/test/results/sample_v2.json \
  --budgetsFile=packages/cli/test/fixtures/budgets.json

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

nice

@paulirish paulirish merged commit 19c7ca6 into main Apr 9, 2024
6 checks passed
@paulirish paulirish deleted the cli-load-file-from-disk branch April 9, 2024 01:47
@fahmij8
Copy link
Contributor

fahmij8 commented Jul 17, 2024

hey team, sorry to discuss here but is this still working?
I tested it out, but it always says Checking assertions against 0 URL(s), 0 total run(s)
image

Comment on lines 57 to +60
// If we have a budgets file, convert it to our assertions format.
if (budgetsFile) options = await convertBudgetsToAssertions(readBudgets(budgetsFile));

const lhrs = loadSavedLHRs().map(json => JSON.parse(json));
const lhrs = loadSavedLHRs(options.lhr).map(json => JSON.parse(json));
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like if we pass options.lhr it will be gone cause it was replaced by the convertBudgetsToAssertions returned value.

if my understanding is correct & this is a vallid issue, I would love to create PR to fix this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's absolutely right, nice catch. A PR would be appreciated!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! fixes coming right up

Copy link
Contributor

Choose a reason for hiding this comment

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

The fixes are at #1062, @connorjclark.
Could you kindly review it at your convenience?

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.

3 participants