ScaCap/action-surefire-report

[bug] Cannot parse report from jest junit

Closed this issue · 1 comments

The action worked as expected when the tests pass, but on a test failure the action fails on parsing...

Run scacap/action-surefire-report@v1
Going to parse results form /home/runner/work/workers/workers/services/buy-label-worker/junit.xml
Error: Cannot read property 'message' of undefined

This is the report it tried to parse above...

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="jest tests" tests="2" failures="1" errors="0" time="2.856">
  <testsuite name="Buy Label Worker" errors="0" failures="1" skipped="0" timestamp="2020-10-07T02:37:17" time="1.112" tests="2">
    <testcase classname="Buy Label Worker it buys a label" name="Buy Label Worker it buys a label" time="0.001">
    </testcase>
    <testcase classname="Buy Label Worker fails" name="Buy Label Worker fails" time="0.002">
      <failure>Error: expect(received).toEqual(expected) // deep equality

Expected: true
Received: false
    at Object.&lt;anonymous&gt; (/Users/matt/code/workers/services/buy-label-worker/__tests__/unit/index.test..js:25:19)
    at Object.asyncJestTest (/Users/matt/code/workers/.yarn/cache/jest-jasmine2-npm-26.5.2-5ec0f6a601-5aacb6b0c8.zip/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37)
    at /Users/matt/code/workers/.yarn/cache/jest-jasmine2-npm-26.5.2-5ec0f6a601-5aacb6b0c8.zip/node_modules/jest-jasmine2/build/queueRunner.js:45:12
    at new Promise (&lt;anonymous&gt;)
    at mapper (/Users/matt/code/workers/.yarn/cache/jest-jasmine2-npm-26.5.2-5ec0f6a601-5aacb6b0c8.zip/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
    at /Users/matt/code/workers/.yarn/cache/jest-jasmine2-npm-26.5.2-5ec0f6a601-5aacb6b0c8.zip/node_modules/jest-jasmine2/build/queueRunner.js:75:41
    at processTicksAndRejections (internal/process/task_queues.js:97:5)</failure>
    </testcase>
  </testsuite>
</testsuites>

Heres the output with ACTIONS_STEP_DEBUG set to true also in case it helps

Run scacap/action-surefire-report@v1
Going to parse results form /home/runner/work/workers/workers/services/buy-label-worker/junit.xml
##[debug]followSymbolicLinks 'false'
##[debug]followSymbolicLinks 'false'
##[debug]implicitDescendants 'true'
##[debug]omitBrokenSymbolicLinks 'true'
##[debug]Search path '/home/runner/work/workers/workers/services/buy-label-worker/junit.xml'
##[debug]Parsing file /home/runner/work/workers/workers/services/buy-label-worker/junit.xml
Error: Cannot read property 'message' of undefined
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Publish Test Report