question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configurable server listen time for startServerCommand

See original GitHub issue

My app is SSR, and I’ve tried to use “LHCI autorun” but Lighthouse fails to run the correct files (since it seems to run whatever is in a “./dist” or “./public” folder).

I’m trying the complex setup guide now, and ran into using a shell script. My current script looks something like this :

#!/bin/bash

# ... (build condition check)

# ... (server setup)

# Install Lighthouse CI
# If you're already using node to manage your project, add it to your package.json `devDependencies` instead to skip this step.
npm install -g @lhci/cli@0.3.x

# Run a healthcheck to make sure everything looks good before we run collection.
lhci healthcheck --fatal

# Collect Lighthouse reports for our URL.
lhci collect --url=https://google.com --settings.chromeFlags=--no-sandbox \
    lhci upload target=temporary-public-storage \
    || echo "LHCI script failed!" \

# Assert that the reports look good, this command can be configured to ease your Lighthouse transition.
lhci assert --preset="lighthouse:recommended"
EXIT_CODE=$?

# ... (kill server)

exit $EXIT_CODE 

However, on CircleCI when it runs the script, it seems to run the tests on a different port (rather than testing at my url “https://google.com”).

image

Please advise on how to proceed if I want to be testing staging envs, thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
patrickhulcecommented, Mar 17, 2020

Thanks! Let’s focus on the autorun issue because that should definitely be working.

When you were running lhci autorun did you have collect look like the below with url as an array? (Also try changing numberOfRuns to 1 to make sure the configuration is being picked up at all)

{
  "ci": {
    "collect": {
      "numberOfRuns": 1,
      "url": ["https://www.google.com"]
    },
    "assert": {
      "preset": "lighthouse:recommended",
      "assertions": {
        "offscreen-images": "off",
        "uses-webp-images": "off"
      }
    },
    "upload": {
      "target": "temporary-public-storage"
    }
  }
}
1reaction
Tonyhliucommented, Mar 19, 2020

Thanks for your help @patrickhulce !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Continuous Performance Analysis with Lighthouse CI and ...
When the Lighthouse CI runs, it executes the server command and watches for the listen or ready string to determine if the server...
Read more >
Starting PingAuthorize Server at boot time (Unix/Linux) - 9.1
By default, you must use the bin/start-server command to start it manually. To configure PingAuthorize Server to start automatically when the ...
Read more >
http.server — HTTP servers — Python 3.11.1 documentation
This class is used to handle the HTTP requests that arrive at the server. By itself, it cannot respond to any actual HTTP...
Read more >
Starting and Stopping WebLogic Servers - Oracle Help Center
The first time you start a WebLogic Server, enter this initial administrative username and password. If you did not use the Configuration Wizard, ......
Read more >
Symfony Local Web Server
cd my-project/ $ symfony server:start [OK] Web server listening on ... If this is the first time you run the proxy, you must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found