Skip to content

Commit

Permalink
Merge c0882eb into e0b16db
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce committed Oct 6, 2020
2 parents e0b16db + c0882eb commit 15d7550
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 423 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- run: yarn i18n:checks
- run: yarn dogfood-lhci

# Fail if any changes were written to any source files or generated untracked files (ex, from: build/build-cdt-lib.js).
- run: git add -A && git diff --cached --exit-code

# buildtracker runs `git merge-base HEAD origin/master` which needs more history than depth=1. https://github.com/paularmstrong/build-tracker/issues/106
- name: Deepen git fetch (for buildtracker)
run: git fetch --deepen=100
Expand All @@ -58,9 +61,6 @@ jobs:
name: dist
path: dist/

# Fail if any changes were written to source files (ex, from: build/build-cdt-lib.js).
- run: git diff --exit-code

# `unit` includes just unit and proto tests.
unit:
strategy:
Expand Down Expand Up @@ -111,6 +111,9 @@ jobs:
- run: yarn diff:sample-json
if: matrix.os == 'windows-latest'

# Fail if any changes were written to any source files or generated untracked files (ex, from -GA).
- run: git add -A && git diff --cached --exit-code

# `smoke` runs as a matrix across 4 jobs:
# * The smoketest groups are split across two runners, to parallelize.
# * Then, those are run with both Chrome stable and ToT Chromium, in parallel
Expand Down Expand Up @@ -152,6 +155,9 @@ jobs:
- name: Run smoke tests
run: xvfb-run --auto-servernum yarn smoke --debug -j=1 --retries=2 --invert-match ${{ matrix.smoke-test-invert }} $SMOKE_GROUP_1

# Fail if any changes were written to source files.
- run: git diff --exit-code

# Only run smoke tests for windows against stable chrome.
smoke-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -190,3 +196,6 @@ jobs:
- run: sudo apt-get install xvfb
- name: yarn test-bundle
run: xvfb-run --auto-servernum yarn test-bundle

# Fail if any changes were written to source files.
- run: git diff --exit-code
4 changes: 2 additions & 2 deletions lighthouse-core/lib/asset-saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ async function saveArtifacts(artifacts, basePath) {
}

/**
* Save LHR to file located at basePath/lhr.json.
* Save LHR to file located at basePath/lhr.report.json.
* @param {LH.Result} lhr
* @param {string} basePath
*/
function saveLhr(lhr, basePath) {
fs.writeFileSync(`${basePath}/lhr.json`, JSON.stringify(lhr, null, 2));
fs.writeFileSync(`${basePath}/lhr.report.json`, JSON.stringify(lhr, null, 2));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class Runner {
// LHR has now been localized.
const lhr = /** @type {LH.Result} */ (i18nLhr);

// Save lhr to ./latest-run, but only if -A is used.
if (settings.auditMode) {
// Save lhr to ./latest-run, but only if -GA is used.
if (settings.gatherMode && settings.auditMode) {
const path = Runner._getDataSavePath(settings);
assetSaver.saveLhr(lhr, path);
}
Expand Down
7 changes: 6 additions & 1 deletion lighthouse-core/scripts/assert-golden-lhr-unchanged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
pwd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
lhroot_path="$pwd/../.."
lh_tmp_path="$lhroot_path/.tmp"
lh_tmp_artifacts_path="$lh_tmp_path/artifacts"
lh_src_artifacts_path="$lhroot_path/lighthouse-core/test/results/artifacts"

mkdir -p "$lh_tmp_path"
rm -rf "$lh_tmp_artifacts_path"
cp -R "$lh_src_artifacts_path" "$lh_tmp_artifacts_path"

purple='\033[1;35m'
red='\033[1;31m'
Expand All @@ -28,7 +33,7 @@ trap teardown EXIT

colorText "Generating a fresh LHR..." "$purple"
set -x
node "$lhroot_path/lighthouse-cli" -A="$lhroot_path/lighthouse-core/test/results/artifacts" --config-path="$lhroot_path/lighthouse-core/test/results/sample-config.js" --quiet --output=json --output-path="$freshLHRPath"
node "$lhroot_path/lighthouse-cli" -A="$lh_tmp_artifacts_path" --config-path="$lhroot_path/lighthouse-core/test/results/sample-config.js" --quiet --output=json --output-path="$freshLHRPath"
set +x

# remove timing from both
Expand Down
140 changes: 0 additions & 140 deletions lighthouse-core/test/fixtures/artifacts/alphabet-artifacts/lhr.json

This file was deleted.

142 changes: 0 additions & 142 deletions lighthouse-core/test/fixtures/artifacts/empty-artifacts/lhr.json

This file was deleted.

Loading

0 comments on commit 15d7550

Please sign in to comment.