首页 > 解决方案 > Google Lighthouse CI - LHCI 服务器可用于多个自动运行

问题描述

我正在尝试设置Lighthouse CIlhci autorun ,但多次运行时遇到问题。我查看了入门说明并查看了故障排除部分,但没有运气。

如何修改我的 LHCI 项目和 docker LHCI Server ( Docker Server ) 的配置,以便lhci autorun针对最新的 Stash/Bitbucket 运行并且不给我:

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.

我只在第一次运行后获得默认提交显示的结果:

18fcc3e “测试(实用程序):支持 travis 构建上下文测试”

使用我尝试将我的项目配置为指向我的 Stash 存储库,但是在将其添加到我的 lighthouserc.json 后从项目向导设置生成的令牌在http://localhost:9001/applhci wizard上不起作用。我错过了什么?

灯塔rc.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" 
    }
  }
}

标签: continuous-integrationlighthouse

解决方案


即使它失败了,它也会创建一个新的本地提交,允许我收集数据:

git commit --allow-empty -m '重新运行 CI' && git push

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


推荐阅读