From 320fb5ff50dbbf5ec1a317dfe50f3ff429bf70bc Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 13:14:00 -0700 Subject: [PATCH 01/11] extension: expose devtools hooks reliably --- lighthouse-extension/app/src/lighthouse-background.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lighthouse-extension/app/src/lighthouse-background.js b/lighthouse-extension/app/src/lighthouse-background.js index bca3167721fb..30fe1721d0ad 100644 --- a/lighthouse-extension/app/src/lighthouse-background.js +++ b/lighthouse-extension/app/src/lighthouse-background.js @@ -79,8 +79,10 @@ if (typeof module !== 'undefined' && module.exports) { getDefaultCategories, listenForStatus, }; -} else { - // If not require()d, expose on window for devtools, other consumers of file. +} + +if (window) { + // Expose on window for devtools, other consumers of file. // @ts-ignore window.runLighthouseInWorker = runLighthouseInWorker; // @ts-ignore From fbc9a8f5cde782cebe782b0a440c4591fe3a95d6 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 15:25:32 -0700 Subject: [PATCH 02/11] debug --- lighthouse-cli/test/smokehouse/smokehouse.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index 8510b4c0bdb1..55077a2b963e 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -55,7 +55,6 @@ function runLighthouse(url, configPath, isDebug) { `--config-path=${configPath}`, `--output-path=${outputPath}`, '--output=json', - '--quiet', '--port=0', ]; @@ -93,10 +92,10 @@ function runLighthouse(url, configPath, isDebug) { process.exit(runResults.status); } - if (isDebug) { +// if (isDebug) { console.log(`STDOUT: ${runResults.stdout}`); console.error(`STDERR: ${runResults.stderr}`); - } +// } const lhr = fs.readFileSync(outputPath, 'utf8'); if (isDebug) { From a160cec420317fe91a81542f2d2830e07de8abb5 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 15:30:20 -0700 Subject: [PATCH 03/11] Update smokehouse.js --- lighthouse-cli/test/smokehouse/smokehouse.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index 55077a2b963e..dd465e7cbcd6 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -92,10 +92,8 @@ function runLighthouse(url, configPath, isDebug) { process.exit(runResults.status); } -// if (isDebug) { - console.log(`STDOUT: ${runResults.stdout}`); - console.error(`STDERR: ${runResults.stderr}`); -// } + console.log(`STDOUT: ${runResults.stdout}`); + console.error(`STDERR: ${runResults.stderr}`); const lhr = fs.readFileSync(outputPath, 'utf8'); if (isDebug) { From 3f8aacf1828b47531b18e8f635dd16d45798af22 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 15:36:35 -0700 Subject: [PATCH 04/11] Update .appveyor.yml --- .appveyor.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 131130b90981..4e528c2daa8a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,14 +35,8 @@ test_script: - npm --version - yarn --version - which yarn - - yarn lint - - yarn unit - - yarn type-check - # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. - # https://github.com/GoogleChrome/lighthouse/issues/5053 - # - yarn smoke - - yarn smoke ally pwa pwa2 pwa3 dbw redirects seo offline byte tti - + - yarn smoke pwa + cache: #- chrome-win32 -> appveyor.yml,package.json - node_modules -> appveyor.yml,package.json,yarn.lock From 20c6c6f3cd7f69fa7729d9e34d683d2f8832045a Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 15:46:11 -0700 Subject: [PATCH 05/11] revert debugging --- .appveyor.yml | 10 ++++++++-- lighthouse-cli/test/smokehouse/smokehouse.js | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4e528c2daa8a..131130b90981 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,8 +35,14 @@ test_script: - npm --version - yarn --version - which yarn - - yarn smoke pwa - + - yarn lint + - yarn unit + - yarn type-check + # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. + # https://github.com/GoogleChrome/lighthouse/issues/5053 + # - yarn smoke + - yarn smoke ally pwa pwa2 pwa3 dbw redirects seo offline byte tti + cache: #- chrome-win32 -> appveyor.yml,package.json - node_modules -> appveyor.yml,package.json,yarn.lock diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index dd465e7cbcd6..8510b4c0bdb1 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -55,6 +55,7 @@ function runLighthouse(url, configPath, isDebug) { `--config-path=${configPath}`, `--output-path=${outputPath}`, '--output=json', + '--quiet', '--port=0', ]; @@ -92,8 +93,10 @@ function runLighthouse(url, configPath, isDebug) { process.exit(runResults.status); } - console.log(`STDOUT: ${runResults.stdout}`); - console.error(`STDERR: ${runResults.stderr}`); + if (isDebug) { + console.log(`STDOUT: ${runResults.stdout}`); + console.error(`STDERR: ${runResults.stderr}`); + } const lhr = fs.readFileSync(outputPath, 'utf8'); if (isDebug) { From b04de941c170450a4920cc715f912279e7b68994 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 15:56:41 -0700 Subject: [PATCH 06/11] debug again. --- .../test/smokehouse/pwa-expectations.js | 55 ------------------- lighthouse-cli/test/smokehouse/smokehouse.js | 9 ++- 2 files changed, 4 insertions(+), 60 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/pwa-expectations.js b/lighthouse-cli/test/smokehouse/pwa-expectations.js index e8042e40618c..f8542979c8af 100644 --- a/lighthouse-cli/test/smokehouse/pwa-expectations.js +++ b/lighthouse-cli/test/smokehouse/pwa-expectations.js @@ -22,62 +22,7 @@ const pwaDetailsExpectations = { * results. */ module.exports = [ - { - requestedUrl: 'https://airhorner.com', - finalUrl: 'https://airhorner.com/', - audits: { - 'is-on-https': { - score: 1, - }, - 'redirects-http': { - score: 1, - }, - 'service-worker': { - score: 1, - }, - 'works-offline': { - score: 1, - }, - 'viewport': { - score: 1, - }, - 'without-javascript': { - score: 1, - }, - 'load-fast-enough-for-pwa': { - // Ignore speed test; just verify that it ran. - }, - 'webapp-install-banner': { - score: 1, - details: {items: [pwaDetailsExpectations]}, - }, - 'splash-screen': { - score: 1, - details: {items: [pwaDetailsExpectations]}, - }, - 'themed-omnibox': { - score: 1, - details: {items: [{...pwaDetailsExpectations, themeColor: '#2196F3'}]}, - }, - 'content-width': { - score: 1, - }, - // "manual" audits. Just verify in the results. - 'pwa-cross-browser': { - score: null, - scoreDisplayMode: 'manual', - }, - 'pwa-page-transitions': { - score: null, - scoreDisplayMode: 'manual', - }, - 'pwa-each-page-has-url': { - score: null, - scoreDisplayMode: 'manual', - }, - }, - }, { requestedUrl: 'https://www.chromestatus.com/', diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index 8510b4c0bdb1..a66c3fdb47b0 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -55,7 +55,7 @@ function runLighthouse(url, configPath, isDebug) { `--config-path=${configPath}`, `--output-path=${outputPath}`, '--output=json', - '--quiet', + '--verbose', '--port=0', ]; @@ -93,10 +93,9 @@ function runLighthouse(url, configPath, isDebug) { process.exit(runResults.status); } - if (isDebug) { - console.log(`STDOUT: ${runResults.stdout}`); - console.error(`STDERR: ${runResults.stderr}`); - } + + console.log(`STDOUT: ${runResults.stdout}`); + console.error(`STDERR: ${runResults.stderr}`); const lhr = fs.readFileSync(outputPath, 'utf8'); if (isDebug) { From b492902caf3bc853b548909cf227d91da99cc0d8 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 16:14:35 -0700 Subject: [PATCH 07/11] i love this as much as you --- .appveyor.yml | 5 +---- lighthouse-cli/test/smokehouse/smokehouse.js | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 131130b90981..29b3a3638cd1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,13 +35,10 @@ test_script: - npm --version - yarn --version - which yarn - - yarn lint - - yarn unit - - yarn type-check # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. # https://github.com/GoogleChrome/lighthouse/issues/5053 # - yarn smoke - - yarn smoke ally pwa pwa2 pwa3 dbw redirects seo offline byte tti + - yarn smoke pwa cache: #- chrome-win32 -> appveyor.yml,package.json diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index a66c3fdb47b0..ccf93b059c35 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -55,7 +55,6 @@ function runLighthouse(url, configPath, isDebug) { `--config-path=${configPath}`, `--output-path=${outputPath}`, '--output=json', - '--verbose', '--port=0', ]; From 2a06a22291397b26f0d7a8abe824174ea19c89c9 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 16:30:30 -0700 Subject: [PATCH 08/11] you're a great dancer. --- .appveyor.yml | 2 +- .travis.yml | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 29b3a3638cd1..ab66ea7af6dc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,7 +38,7 @@ test_script: # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. # https://github.com/GoogleChrome/lighthouse/issues/5053 # - yarn smoke - - yarn smoke pwa + - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=/Users/paulirish/code/lighthouse/lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 cache: #- chrome-win32 -> appveyor.yml,package.json diff --git a/.travis.yml b/.travis.yml index 71dbc2ad8998..5e94d82042cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,14 +33,7 @@ before_script: - yarn build-all script: - yarn bundlesize - - yarn lint - - yarn unit:silentcoverage - - yarn type-check - - yarn diff:sample-json - - yarn smoke:silentcoverage - - yarn test-extension - - yarn test-viewer - - yarn test-lantern + - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=/Users/paulirish/code/lighthouse/lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 # _JAVA_OPTIONS is breaking parsing of compiler output. See #3338. - unset _JAVA_OPTIONS # FIXME(paulirish): re-enable after a roll of LH->CDT From 0a26bbf2ca4eb4eea3f8300be47486e6cee5ecd9 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 16:35:13 -0700 Subject: [PATCH 09/11] call your mother. --- .appveyor.yml | 2 +- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ab66ea7af6dc..d72c135d760d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,7 +38,7 @@ test_script: # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. # https://github.com/GoogleChrome/lighthouse/issues/5053 # - yarn smoke - - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=/Users/paulirish/code/lighthouse/lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 + - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 cache: #- chrome-win32 -> appveyor.yml,package.json diff --git a/.travis.yml b/.travis.yml index 5e94d82042cf..16ae1e786a68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_script: - yarn build-all script: - yarn bundlesize - - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=/Users/paulirish/code/lighthouse/lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 + - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 # _JAVA_OPTIONS is breaking parsing of compiler output. See #3338. - unset _JAVA_OPTIONS # FIXME(paulirish): re-enable after a roll of LH->CDT From 05532a3740732eb2593d374be80883ecdb5d3c50 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 16:46:12 -0700 Subject: [PATCH 10/11] take a walk around the block with someone special. --- lighthouse-extension/app/src/lighthouse-background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-extension/app/src/lighthouse-background.js b/lighthouse-extension/app/src/lighthouse-background.js index 30fe1721d0ad..523afb9ab068 100644 --- a/lighthouse-extension/app/src/lighthouse-background.js +++ b/lighthouse-extension/app/src/lighthouse-background.js @@ -81,7 +81,7 @@ if (typeof module !== 'undefined' && module.exports) { }; } -if (window) { +if (typeof window !== 'undefined') { // Expose on window for devtools, other consumers of file. // @ts-ignore window.runLighthouseInWorker = runLighthouseInWorker; From d111a4c4656302d81f2ebfc296f255083d37af91 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 28 Jun 2018 17:14:53 -0700 Subject: [PATCH 11/11] revert debugging. don't worry, they still think very fondly of you. truly. --- .appveyor.yml | 5 +- .travis.yml | 9 ++- .../test/smokehouse/pwa-expectations.js | 55 +++++++++++++++++++ lighthouse-cli/test/smokehouse/smokehouse.js | 8 ++- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d72c135d760d..131130b90981 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,10 +35,13 @@ test_script: - npm --version - yarn --version - which yarn + - yarn lint + - yarn unit + - yarn type-check # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. # https://github.com/GoogleChrome/lighthouse/issues/5053 # - yarn smoke - - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 + - yarn smoke ally pwa pwa2 pwa3 dbw redirects seo offline byte tti cache: #- chrome-win32 -> appveyor.yml,package.json diff --git a/.travis.yml b/.travis.yml index 16ae1e786a68..71dbc2ad8998 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,14 @@ before_script: - yarn build-all script: - yarn bundlesize - - node lighthouse-cli/index.js https://www.chromestatus.com/ --config-path=lighthouse-cli/test/smokehouse/pwa-config.js --output-path=smokehouse-55623.report.json --output=json --port=0 + - yarn lint + - yarn unit:silentcoverage + - yarn type-check + - yarn diff:sample-json + - yarn smoke:silentcoverage + - yarn test-extension + - yarn test-viewer + - yarn test-lantern # _JAVA_OPTIONS is breaking parsing of compiler output. See #3338. - unset _JAVA_OPTIONS # FIXME(paulirish): re-enable after a roll of LH->CDT diff --git a/lighthouse-cli/test/smokehouse/pwa-expectations.js b/lighthouse-cli/test/smokehouse/pwa-expectations.js index f8542979c8af..e8042e40618c 100644 --- a/lighthouse-cli/test/smokehouse/pwa-expectations.js +++ b/lighthouse-cli/test/smokehouse/pwa-expectations.js @@ -22,7 +22,62 @@ const pwaDetailsExpectations = { * results. */ module.exports = [ + { + requestedUrl: 'https://airhorner.com', + finalUrl: 'https://airhorner.com/', + audits: { + 'is-on-https': { + score: 1, + }, + 'redirects-http': { + score: 1, + }, + 'service-worker': { + score: 1, + }, + 'works-offline': { + score: 1, + }, + 'viewport': { + score: 1, + }, + 'without-javascript': { + score: 1, + }, + 'load-fast-enough-for-pwa': { + // Ignore speed test; just verify that it ran. + }, + 'webapp-install-banner': { + score: 1, + details: {items: [pwaDetailsExpectations]}, + }, + 'splash-screen': { + score: 1, + details: {items: [pwaDetailsExpectations]}, + }, + 'themed-omnibox': { + score: 1, + details: {items: [{...pwaDetailsExpectations, themeColor: '#2196F3'}]}, + }, + 'content-width': { + score: 1, + }, + // "manual" audits. Just verify in the results. + 'pwa-cross-browser': { + score: null, + scoreDisplayMode: 'manual', + }, + 'pwa-page-transitions': { + score: null, + scoreDisplayMode: 'manual', + }, + 'pwa-each-page-has-url': { + score: null, + scoreDisplayMode: 'manual', + }, + }, + }, { requestedUrl: 'https://www.chromestatus.com/', diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index ccf93b059c35..8510b4c0bdb1 100755 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -55,6 +55,7 @@ function runLighthouse(url, configPath, isDebug) { `--config-path=${configPath}`, `--output-path=${outputPath}`, '--output=json', + '--quiet', '--port=0', ]; @@ -92,9 +93,10 @@ function runLighthouse(url, configPath, isDebug) { process.exit(runResults.status); } - - console.log(`STDOUT: ${runResults.stdout}`); - console.error(`STDERR: ${runResults.stderr}`); + if (isDebug) { + console.log(`STDOUT: ${runResults.stdout}`); + console.error(`STDERR: ${runResults.stderr}`); + } const lhr = fs.readFileSync(outputPath, 'utf8'); if (isDebug) {