Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid count value #107

Closed
wholebuzz opened this issue Jun 4, 2021 · 7 comments
Closed

Invalid count value #107

wholebuzz opened this issue Jun 4, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@wholebuzz
Copy link

Seemed to throw error instead of printing logs for me. Will try cypress-log-to-output next.

 From Node.js Internals:
    RangeError: Invalid count value
        at String.repeat (<anonymous>)
        at logToTerminal (/home/runner/work/wholebuzz/wholebuzz/node_modules/cypress-terminal-report/src/installLogsPrinter.js:226:29)
        at ctrLogMessages (/home/runner/work/wholebuzz/wholebuzz/node_modules/cypress-terminal-report/src/installLogsPrinter.js:86:9)
        at invoke (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/child/task.js:47:14)
        at /home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/util.js:41:14
        at tryCatcher (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
        at Function.Promise.attempt.Promise.try (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
        at Object.wrapChildPromise (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/util.js:40:23)
        at Object.wrap (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/child/task.js:53:8)
        at execute (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/child/run_plugins.js:127:19)
        at EventEmitter.<anonymous> (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/child/run_plugins.js:202:5)
        at EventEmitter.emit (events.js:315:20)
        at process.<anonymous> (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)
        at process.emit (events.js:315:20)
        at process.emit (/home/runner/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/source-map-support/source-map-support.js:495:21)
        at emit (internal/child_process.js:876:12)
@archfz archfz added the bug Something isn't working label Jun 4, 2021
@archfz
Copy link
Owner

archfz commented Jun 4, 2021

Can you provide reproduction steps? Plugin and cypress version?

@wholebuzz
Copy link
Author

wholebuzz commented Jun 4, 2021

Cypress 6.6.0 and cypress-terminal-report 3.2.1. I followed the installation instructions and then ran a failing cypress integration test. FWIW cypress-log-to-output didn't work either, or rather doesn't support electron. The only thing I've found that works is setting DEBUG=cypress:server:browsers:electron. However this outputs a huge amount of useless information in addition to the desired console.log output.

@archfz
Copy link
Owner

archfz commented Jun 4, 2021

Does this reproduce only with cypress run or it also reproduces on cypress open?

@archfz
Copy link
Owner

archfz commented Jun 4, 2021

DEBUG=cypress:server:browsers:electron works? So does this mean that its an issue with firefox or chrome browser?

@wholebuzz
Copy link
Author

I've only reproduced it with cypress run. I'm debugging a test that only fails when run from GitHub Actions. I meant the DEBUG environment variable is only way I've been able to retrieve console.log. It superficially seems the bug is something related to the tabLevel code in cypress-terminal-report. I'm running a test now downgrading to version 2.3.1 (because I see there is no more tabLevel in that verison of the code). Will see if it works in about 30 min.

@wholebuzz
Copy link
Author

Version 2.3.1 (as opposed to 3.2.1) of cypress-terminal-report works for me.

archfz added a commit that referenced this issue Jun 6, 2021
archfz added a commit that referenced this issue Jun 6, 2021
@archfz
Copy link
Owner

archfz commented Jun 6, 2021

Theoretical fix was released in 3.2.2.

I was not able to reproduce the issue. The issue I suppose is that the current code relies on a fact that all (mocha (cypress uses it)) tests should have at-least one parent context() or describe(). Now maybe the code determining this is somehow wrong in some case, or it is possible to have tests without parent somehow. If the case the structure of the failing tests might give us more clues.

In any case the current code protects itself against invalid calculation here and defaults to 0 tab level. If in any case you need more recent features you can upgrade and see if it works correctly.

@archfz archfz closed this as completed Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants