Skip to content

Document CI threshold checks with jq - #26

Open
nucliweb wants to merge 1 commit into
ChromeDevTools:mainfrom
nucliweb:readme-ci-thresholds
Open

nucliweb wants to merge 1 commit into
ChromeDevTools:mainfrom
nucliweb:readme-ci-thresholds

Conversation

@nucliweb

Copy link
Copy Markdown
Contributor

Add a "Check thresholds in CI" section after the JSON output docs. It shows two jq -e checks: one for LCP and CLS thresholds, and one that fails when a Core Web Vital has a poor rating. In jq, null <= 2500 is true, so the first check uses // infinite to fail when the trace has no value for a metric.

This replaces the --fail-on option proposed in #9, as agreed in #9 (comment).

Verification

Ran both checks on a real Chrome trace (LCP 2856 ms, CLS 0.28). The threshold check exits 1 with 2500 ms and 0.1, and exits 0 with 5000 ms and 0.3. The rating check exits 1. On a trace with no Core Web Vitals, the threshold check exits 1.

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.

1 participant