MCPcopy
hub / github.com/ampproject/amphtml / visualDiff

Function visualDiff

build-system/tasks/visual-diff/index.js:596–623  ·  view source on GitHub ↗

* Runs the AMP visual diff tests. * @return {Promise }

()

Source from the content-addressed store, hash-verified

594 * @return {Promise<void>}
595 */
596async function visualDiff() {
597 const handlerProcess = createCtrlcHandler('visual-diff');
598 await ensureOrBuildAmpRuntimeInTestMode_();
599 decodePercyTokenForCi();
600 maybeOverridePercyEnvironmentVariables();
601 setPercyBranch();
602 setPercyTargetCommit();
603
604 if (argv.grep) {
605 argv.grep = RegExp(argv.grep);
606 }
607
608 if (argv.dev) {
609 argv['percy_disabled'] = true;
610 }
611
612 if (!argv.percy_disabled && !process.env.PERCY_TOKEN) {
613 log('fatal', 'Could not find', cyan('PERCY_TOKEN'), 'environment variable');
614 }
615
616 const percy = await launchPercyAgent();
617 try {
618 await performVisualTests();
619 } finally {
620 await percy?.stop();
621 }
622 exitCtrlcHandler(handlerProcess);
623}
624
625/**
626 * Runs the AMP visual diff tests.

Callers

nothing calls this directly

Calls 10

decodePercyTokenForCiFunction · 0.85
setPercyBranchFunction · 0.85
setPercyTargetCommitFunction · 0.85
cyanFunction · 0.85
launchPercyAgentFunction · 0.85
performVisualTestsFunction · 0.85
logFunction · 0.70
stopMethod · 0.45

Tested by

no test coverage detected