carlesnunez / lighthouse-gh-reporter

The configurable lighthouse github reporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Travis error

AdrienLemaire opened this issue · comments

Version: lighthouse-gh-reporter ^1.3.1

config:

{
  "scripts": {
    "test:lighthouse:ci": "lighthouse-github-reporter run -- --prId=${TRAVIS_PULL_REQUEST}",
  },
  "config": {
    "lighthouse-github-reporter": {
      "urls": [
        "https://project.local"
      ],
      "apiUrl": "https://api.github.com",
      "owner": "company",
      "repository": "repo",
      "reporterUserName": "Fandekasp",
      "noiseLevel": "low",
      "scoreThresholds": {
        "performance": 5,
        "pwa": 27,
        "accessibility": 58,
        "best-practices": 100,
        "seo": 90
      }
    }
  }
}

Log from Travis

yarn test:lighthouse:ci
yarn run v1.3.2
(node:19390) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ lighthouse-github-reporter run -- --prId=${TRAVIS_PULL_REQUEST}
[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4
NOISE LEVEL IS LOW - REMOVING OLD GITHUB COMMENTS ON PR-false
Generating lighthouse report...
(node:19419) UnhandledPromiseRejectionWarning: HttpError: Invalid value for parameter 'number': "false" is NaN
    at values.forEach (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:89:17)
    at Array.forEach (<anonymous>)
    at Object.keys.forEach.parameterName (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:54:12)
    at Array.forEach (<anonymous>)
    at validate (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:32:31)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
(node:19419) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19419) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Lighthouse generated report for 1 urls
Sending report to github pr-false asFandekasp
(node:19419) UnhandledPromiseRejectionWarning: HttpError: Invalid value for parameter 'number': "false" is NaN
    at values.forEach (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:89:17)
    at Array.forEach (<anonymous>)
    at Object.keys.forEach.parameterName (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:54:12)
    at Array.forEach (<anonymous>)
    at validate (/home/travis/build/company/project/repo/node_modules/@octokit/rest/lib/plugins/endpoint-methods/validate.js:32:31)
(node:19419) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Done in 6.07s.
The command "cd $HOME/build/company/project/repo/
yarn test:lighthouse:ci
" exited with 0.

Any idea why I'm getting these HttpError: Invalid value for parameter 'number' errors ?

Hello Fandekasp! First of all thank you for using and share your issues with the community.

Can you provide more info?

  • Does travis have visibility to the url in which are you accessing?
  • Does TRAVIS_PULL_REQUEST variable have any access??

It sounds like TRAVIS_PULL_REQUEST is === false so it won't work probably.

https://docs.travis-ci.com/user/environment-variables/#convenience-variables

TRAVIS_PULL_REQUEST is set to the pull request number if the current job is a pull request build, or false if it’s not.

Does your problem got fixed @Fandekasp ?