Skip to content

Commit dedf550

Browse files
author
zengfr
committed
fix(governance): use path-only URLs in lighthouse config
treosh/lighthouse-ci-action internally spins up a static server for staticDistDir, and exposes URLs relative to that server. Using absolute http://localhost/ URLs made Chrome hit port 80 which had no server. Switch to path-only URLs so treosh prepends its own server URL. Also revert the python startServerCommand hack; lhci staticDistDir mode does not need it.
1 parent 416f162 commit dedf550

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎website/.lighthouserc.cjs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
// ADR-0016: docs/adr/ADR-0016-direction-a-governance.md
44
// CI: .github/workflows/governance.yml
55
//
6-
// Strategy: serve the static export via python3 (already on GH runners),
7-
// let lhci spawn Chrome to crawl the URLs.
6+
// Strategy: treosh/lighthouse-ci-action runs lhci collect, which spawns
7+
// Chrome to crawl the URLs. lhci supports staticDistDir, but treosh
8+
// action wraps it with its own static server, so URLs are just paths.
89

910
'use strict';
1011

@@ -13,16 +14,15 @@ module.exports = {
1314
collect: {
1415
// Static export directory produced by `next build`.
1516
staticDistDir: './out',
16-
startServerCommand: 'python3 -m http.server 3000 --directory ./out',
17-
startServerReadyPattern: 'Serving HTTP',
18-
startServerReadyTimeout: 30000,
1917
// Test the 4 highest-priority locales + the root redirect target.
18+
// URLs use root-relative paths because lhci+staticDistDir auto-
19+
// prefixes the dynamic port assigned by treosh's internal server.
2020
url: [
21-
'http://localhost/',
22-
'http://localhost/en/',
23-
'http://localhost/zh/',
24-
'http://localhost/ja/',
25-
'http://localhost/ko/',
21+
'/',
22+
'/en/',
23+
'/zh/',
24+
'/ja/',
25+
'/ko/',
2626
],
2727
numberOfRuns: 1,
2828
settings: {

0 commit comments

Comments
 (0)