tests(runner): drop usages of legacy runner#15047
Conversation
|
Previously the new runner was being given a gatherFn that just ran the legacy runner to do the collection (which we mocked the hell out of to get what we want). This PR stops using legacy runner to fill out the gatherFn and instead uses various bits of the navigation runner implementation. Also, legacy config stuff is replaced with calls to Is that everything? |
| }); | ||
| }); | ||
|
|
||
| it('rejects when given neither passes nor artifacts', async () => { |
There was a problem hiding this comment.
The general purpose runner is not responsible for checking this, the error is specific to _gatherArtifactsFromBrowser
There was a problem hiding this comment.
What checks the equivalent now?
There was a problem hiding this comment.
navigation-runner.js (sort of)
It rejects when there are no "config navigations" but there should always be 1 even if the artifacts array on the config doesn't exist or is empty.
lighthouse/core/test/gather/navigation-runner-test.js
Lines 193 to 196 in 3ba11a8
| }); | ||
| }); | ||
|
|
||
| it('rejects when given an invalid trace artifact', async () => { |
There was a problem hiding this comment.
Trace artifact is not given special treatment by the FR runner anymore
| expect(lhr.runtimeError.message).toMatch(/did not paint any content.*\(NO_FCP\)/); | ||
| }); | ||
|
|
||
| it('includes a pageLoadError runtimeError over any gatherer runtimeErrors', async () => { |
There was a problem hiding this comment.
The general purpose runner is not responsible for this logic
There was a problem hiding this comment.
navigation-runner.js
lighthouse/core/test/gather/navigation-runner-test.js
Lines 447 to 462 in 3ba11a8
Yes + removing some obsolete tests |
| }); | ||
| }); | ||
|
|
||
| it('rejects when given neither passes nor artifacts', async () => { |
There was a problem hiding this comment.
What checks the equivalent now?
| 'user-timings', | ||
| ], | ||
| artifacts: [ | ||
| {id: 'Trace', gatherer: 'trace'}, |
There was a problem hiding this comment.
are artifacts not optional if you're loading via auditMode?
There was a problem hiding this comment.
They are optional, but initializeConfig filters out any audits because all required artifacts are missing.
| expect(lhr.runtimeError.message).toMatch(/did not paint any content.*\(NO_FCP\)/); | ||
| }); | ||
|
|
||
| it('includes a pageLoadError runtimeError over any gatherer runtimeErrors', async () => { |
Runner._gatherArtifactsFromBrowseringatherFnLegacyResolvedConfig.fromJsoncalls to newinitializeConfig