Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP tests: use --headless=chrome for smoke tests #13820

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ jobs:
- run: yarn build-report
- run: yarn reset-link

- run: sudo apt-get install xvfb
- name: Run smoke tests
run: |
xvfb-run --auto-servernum yarn c8 yarn smoke --debug -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL
yarn c8 yarn smoke --debug -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL
yarn c8 report --reporter text-lcov > smoke-coverage.lcov

- name: Upload test coverage to Codecov
Expand Down Expand Up @@ -135,9 +134,8 @@ jobs:
- run: yarn build-report
- run: yarn reset-link

- run: sudo apt-get install xvfb
- name: yarn smoke --fraggle-rock
run: xvfb-run --auto-servernum yarn smoke --debug --fraggle-rock -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL
run: yarn smoke --debug --fraggle-rock -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL

# Fail if any changes were written to source files.
- run: git diff --exit-code
Expand Down Expand Up @@ -175,9 +173,8 @@ jobs:
- run: yarn build-report
- run: yarn build-devtools

- run: sudo apt-get install xvfb
- name: yarn test-bundle
run: xvfb-run --auto-servernum yarn test-bundle --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL
run: yarn test-bundle --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL

# Fail if any changes were written to source files.
- run: git diff --exit-code
Expand Down
3 changes: 3 additions & 0 deletions docs/headless-chrome.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Kick off run of Lighthouse using headless Chrome:
lighthouse --chrome-flags="--headless" https://github.com
```

There is also the new `--headless=chrome` option, which includes functionality that
was explicitly omitted from the original headless browser.

## CLI (xvfb)

Alternatively, you can run full Chrome + xvfb instead of headless mode. These steps worked on Debian Jessie:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ async function runBundledLighthouse(url, configJson, testRunnerOptions) {
const lighthouse = global.runBundledLighthouse;

// Launch and connect to Chrome.
const launchedChrome = await ChromeLauncher.launch();
const launchedChrome = await ChromeLauncher.launch({
chromeFlags: [
'--headless=chrome',
],
});
const port = launchedChrome.port;

// Run Lighthouse.
Expand Down
1 change: 1 addition & 0 deletions lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ async function internalRun(url, tmpPath, configJson, options) {
`-A=${artifactsDirectory}`,
'--port=0',
'--quiet',
'--chrome-flags=--headless=chrome',
];

if (useFraggleRock) {
Expand Down