Improved assertMatrix overlap behavior
See original GitHub issueI was trying to use assertMatrix with preset like this:
myconfig.yml
assert:
preset: "lighthouse:recommended"
assertMatrix:
- matchingUrlPattern: "devserver.com"
assertions:
is-crawlable:
- off # Dev servers are not crawlable.
However, this results in an error:
Error: Cannot use assertMatrix with other options
at getAllAssertionResults (/usr/local/lib/node_modules/@lhci/cli/node_modules/@lhci/utils/src/assertions.js:486:13)
at Object.runCommand (/usr/local/lib/node_modules/@lhci/cli/src/assert/assert.js:58:22)
at run (/usr/local/lib/node_modules/@lhci/cli/src/cli.js:106:23)
at Object.<anonymous> (/usr/local/lib/node_modules/@lhci/cli/src/cli.js:137:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
What I’m trying to do: I want to use the default checks, but I have a few specific pages that I know will fail a few specific checks. So I was hoping to use assertMatrix
to disable such checks for those specific pages.
If I remove preset
, I can use assertMatrix
, but then I have to create the entire list of assertions that "lighthouse-recommended"
checks for myself. In that case, it would be easier to create several different config files for each case that needs special exceptions… but I was hoping to avoid creating multiple config files by using assertMatrix
. Is there some way to do that?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Improved assertMatrix overlap behavior - Bountysource
I was trying to use assertMatrix with preset like this: myconfig.yml assert: preset: "lighthouse:recommended" assertMatrix: ...
Read more >Learning in High Dimension Always Amounts to Extrapolation
In this post I'll attempt to shed some light on the conclusion that is drawn (in part) from the above image:.
Read more >Lightweight Specifications for Parallel Correctness - DTIC
of the intended, correct parallel behavior of his or her software. ... tions with a small number of overlapping @assert atomic blocks, ...
Read more >mir.ndslice.topology - D Programming Language
windows, n-dimensional slice of n-dimensional overlapping windows. ... Special behavior for pointers to a constant data.
Read more >Concept-Controlled Polymorphism - CiteSeerX
Overload resolution must consider both definitions to select the better match. ... Thus some data would be lost, leading to undefined behavior at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think in my case the second option would be more helpful. An even more complete example of what I’m trying to do:
So ideally, I want to test all of the pages with
lighthouse:recommended
, but I need to exempt several different paths from various checks because of things I have no control over (third-party code, issues with the CMS I cannot easily change, etc.) I was trying to find a way to define a set of default, very strict criteria and then make a list of exceptions from certain tests for specific paths.Ah, I see. The entries in assertMatrix don’t override each other. They’re additive.
assertMatrix
+matchingUrlPattern
is like saying “for all URLs that match this pattern, always assert at least these things”. You’d need to configure.*
to be the minimal set of things that applies to all pages, and then add in individual URLs.I see two main features that would help make this situation easier.
excludingUrlPattern
which would be the inverse ofmatchingUrlPattern
(meaning you flip is-crawlable to ‘on’ and matchingUrlPattern to excludingUrlPattern in your 2nd example, addis-crawlable: 'off'
to all pages to achieve the desired effect)assertMatrixOverlapBehavior
which would control whether to useadditive
style today,merge
which would basically do anObject.assign
(based on your config I’m assuming this is what you thought would happen?), orreplace
which would only use the first matching pattern.Do either of those sound especially useful for your situation?