partizan
partizan

Reputation: 469

Google Lighthouse CI - LHCI Server to work for multiple autorun(s)

I'm trying to setup Lighthouse CI but having issues running lhci autorun multiple times. I went over the Getting Started instructions and reviewed Troubleshooting section but no luck.

How can I modify the configuration of my LHCI project and docker LHCI Server (Docker Server) so that the lhci autorun runs against the latest Stash/Bitbucket and doesn't give me:

Error: Unexpected status code 422
  {"message":"Build already exists for hash \"18fcc3e730cc720756eba4b9a94a778b60d5e1e0\""}
    at ApiClient._convertFetchResponseToReturnValue (/usr/local/lib/node_modules/@lhci/cli/node_modules/@lhci/utils/src/api-client.js:54:21)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
WARNING: upload command failed.
assert command failed. Exiting with status code 1.

I get results only for the default commit show after my first run:

18fcc3e "tests(utils): support travis build context tests"

Using lhci wizard I tried configuring my project to point to my Stash repo but the token that got generated from the project wizard setup after adding it to my lighthouserc.json it doesn't work on http://localhost:9001/app. What am I missing?

lighthouserc.json

{
  "ci": { 
    "server": {
      "port": 9001,
      "storage": {
        "storageMethod": "sql",
        "sqlDialect": "sqlite",
        "sqlDatabasePath": "/data/lhci.db"
      }
    },
    "collect": {
      "numberOfRuns": 2,
      "url": [
        "https://wwww.mydomain.ca/",
        "https://www.mydomain.ca/page2", 
      ]
    }, 
    "upload": {
      "target": "lhci",
      "serverBaseUrl": "http://localhost:9001",
      "token": "38c17168748-c5f8-4744-b05d-3fdc97806adfabf" 
    }
  }
}

Upvotes: 1

Views: 3834

Answers (1)

partizan
partizan

Reputation: 469

Even though it fails, it creates a new local commit that allows me to collect data:

git commit --allow-empty -m 'rerun CI' && git push

from: https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/troubleshooting.md

Upvotes: 1

Related Questions