okTurtles / group-income

A decentralized and private (end-to-end encrypted) financial safety net for you and your friends.
https://groupincome.org
GNU Affero General Public License v3.0
329 stars 43 forks source link

Limit Cypress test failure logs to 500 lines #2339

Closed taoeffect closed 4 days ago

taoeffect commented 1 week ago

Problem

Sometimes it seems like the Cypress Dashboard video fails to upload because the amount of data we're sending to Cypress is too much. Most likely this has less to do with the video and more to do with the logs (or at least the logs are something we can control).

Solution

Modify output-logs.js:

Cypress.on('fail', (error) => {
  error.stack += '\nConsole Logs:\n========================\n'
  error.stack += '[' + logs + ' null]'
  // clear logs after fail so we dont see duplicate logs
  logs = ''
  // still need to throw the error so tests wont be marked as a pass
  throw error
})

Modify that line error.stack += '[' + logs + ' null]' to include only up to the last 500 lines from that array.