Skip to content

fix: incorrect handling of test results that never ran properly #48

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

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

alexplischke
Copy link

Description

A test may never have run correctly to completion—worker crashed—and therefore never had any results. The reporter would fail multiple times in this case:

  1. stack is not a method on Error.
Error in reporter TypeError: e.stack is not a function
    at SauceReporter.onEnd (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:155:75)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ReporterV2Wrapper.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/reporterV2.js:91:12)
    at wrapAsync (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:79:12)
    at Multiplexer.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:51:25)
    at InternalReporter.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/internalReporter.js:69:12)
    at Runner.runAllTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/runner/runner.js:78:28)
    at runTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:207:85)
    at t.<anonymous> (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:54:7)
  1. duration could not be calculated correctly because the code was expecting test results:
failed to send report to insights,  TypeError: Cannot read properties of undefined (reading 'duration')
    at forEach (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:207:40)
    at Array.forEach (<anonymous>)
    at SauceReporter.getDuration (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:205:25)
    at SauceReporter.reportTestRun (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:177:28)
    at SauceReporter.onEnd (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:152:32)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ReporterV2Wrapper.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/reporterV2.js:91:12)
    at wrapAsync (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:79:12)
    at Multiplexer.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:51:25)
    at InternalReporter.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/internalReporter.js:69:12)
    at Runner.runAllTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/runner/runner.js:78:28)
    at runTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:207:85)
    at t.<anonymous> (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:54:7)
  1. Same as 2. but for error:
failed to send report to insights:  TypeError: Cannot read properties of undefined (reading 'error')
    at forEach (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:222:32)
    at Array.forEach (<anonymous>)
    at SauceReporter.findErrors (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:220:25)
    at SauceReporter.reportTestRun (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:182:26)
    at SauceReporter.onEnd (/Users/alexplischke/devel/sauce-playwright-reporter/lib/reporter.js:152:32)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ReporterV2Wrapper.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/reporterV2.js:91:12)
    at wrapAsync (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:79:12)
    at Multiplexer.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/multiplexer.js:51:25)
    at InternalReporter.onEnd (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/reporters/internalReporter.js:69:12)
    at Runner.runAllTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/runner/runner.js:78:28)
    at runTests (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:207:85)
    at t.<anonymous> (/Users/alexplischke/devel/saucectl-playwright-example/node_modules/playwright/lib/program.js:54:7)

@alexplischke alexplischke requested a review from a team as a code owner July 16, 2024 23:32
@alexplischke alexplischke changed the title fix: incorrect handling of tests that never ran properly fix: incorrect handling of test results that never ran properly Jul 16, 2024
@alexplischke alexplischke merged commit 0ce70ca into main Jul 16, 2024
2 checks passed
@alexplischke alexplischke deleted the ap-error-upon-error branch July 16, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants