From dee182a1f741baf49c8cb8ad6afb2d1cd4c320ab Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Fri, 30 Apr 2021 18:17:59 -0600 Subject: [PATCH] misc: do not publish lighthouse-cli/test except smokehouse (#12415) --- .npmignore | 7 +++++-- lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js | 2 +- lighthouse-core/scripts/release/test.sh | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.npmignore b/.npmignore index 8ce1a4dbb749..b7e1728c50bb 100644 --- a/.npmignore +++ b/.npmignore @@ -22,8 +22,11 @@ lighthouse-logger/ !lighthouse-core/scripts/manual-chrome-launcher.js !lighthouse-core/scripts/download-chrome.sh -# keep smokehouse tests, etc -!lighthouse-cli/test +# Exclude the CLI smoketests but keep the smoketest runner that is used +# by downstream projects (e.g. publisher ads). +lighthouse-cli/test/cli +lighthouse-cli/test/fixtures +lighthouse-cli/test/smokehouse/test-definitions results/ lantern-data/ diff --git a/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js b/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js index b19357d294bd..64ff9c726ce1 100644 --- a/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +++ b/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js @@ -19,7 +19,7 @@ const log = require('lighthouse-logger'); const {runSmokehouse} = require('../smokehouse.js'); const {server, serverForOffline} = require('../../fixtures/static-server.js'); -const coreTestDefnsPath = require.resolve('../test-definitions/core-tests.js'); +const coreTestDefnsPath = `${__dirname}/../test-definitions/core-tests.js`; /** * Possible Lighthouse runners. Loaded dynamically so e.g. a CLI run isn't diff --git a/lighthouse-core/scripts/release/test.sh b/lighthouse-core/scripts/release/test.sh index 2026e643a90a..8ae8b24ba89d 100755 --- a/lighthouse-core/scripts/release/test.sh +++ b/lighthouse-core/scripts/release/test.sh @@ -36,8 +36,10 @@ cd /tmp/lighthouse-local-test npm init -y npm install "$LH_PRISTINE_ROOT/lighthouse-$VERSION.tgz" -cd node_modules/lighthouse/lighthouse-cli/test/ && npm install lodash.clonedeep && cd ../../../../ -npm explore lighthouse -- npm run smoke -- --retries=3 +npx add-dependencies package.json mime-types lodash.clonedeep +npm install --only=prod +cp -r "$LH_PRISTINE_ROOT/lighthouse-cli/test/fixtures" node_modules/lighthouse/lighthouse-cli/test +npm explore lighthouse -- npm run smoke -- --tests-path "$LH_PRISTINE_ROOT/lighthouse-cli/test/smokehouse/test-definitions/core-tests.js" --retries=3 npm explore lighthouse -- npm run fast -- http://example.com cd "$LH_PRISTINE_ROOT"