Cypress: `cypress run` does not log `stderr` from plugins

Created on 21 Nov 2019  路  8Comments  路  Source: cypress-io/cypress

Current behavior:

Run this existing spec that has a plugin which logs to process.stderr:

npm run cypress:run -- --project ./packages/server/test/support/fixtures/projects/system-node
npm run cypress:open -- --project ./packages/server/test/support/fixtures/projects/system-node

https://github.com/cypress-io/cypress/blob/99ec5c7b41dd6865dda9a597cc686b19280d6a39/packages/server/test/support/fixtures/projects/system-node/cypress/plugins/index.js#L1-L5

It will log in cypress open, but not cypress run.

Desired behavior:

The pluginsfile should log either way.

cli first-timers-only ready for work cli output

All 8 comments

The culprit is that this code path will cause the onStderrData callback to always return falsey:

https://github.com/cypress-io/cypress/blob/99ec5c7b41dd6865dda9a597cc686b19280d6a39/cli/lib/exec/spawn.js#L238-L256

I believe this was a mistake, as line 252 returns false, but there is no "default case" that returns true after that.

If you add "return true", once again, output will contain Electron debug information (#4255). But we can just filter that out or not set ELECTRON_ENABLE_LOGGING at any point.

HI @jennifer-shehane ,
I would like to take this issue.

@santoshyadav198613 Feel free to pick this issue up, ping me if you have any questions. I think changing that onStderrData callback to return true will be a good starting point.

Hi @flotwig ,
Are we looking for this to be logged?
image

Hi @flotwig ,
PR is open now.

Hi @flotwig ,
Are we looking for this to be logged?
image

Yep, that's great!

Hi @flotwig,
Cool just need some help on Testing , mentioned the error which I am getting in PR.

Nice

Was this page helpful?
0 / 5 - 0 ratings