pmeier / pytest-results-action

Summarize `pytest` test results in GitHub Actions
BSD 3-Clause "New" or "Revised" License
13 stars 6 forks source link

TypeError: Cannot convert undefined or null to object #21

Closed yrro closed 1 month ago

yrro commented 5 months ago

I'm getting:

Run pmeier/pytest-results-action@v0.6.0
/home/runner/work/_actions/pmeier/pytest-results-action/v0.6.0/dist/index.js:7281
      if (Object.hasOwn(result, "failure")) {
                 ^

TypeError: Cannot convert undefined or null to object
    at Function.hasOwn (<anonymous>)
    at extractResults (/home/runner/work/_actions/pmeier/pytest-results-action/v0.6.0/dist/index.js:7281:18)
    at async postResults (/home/runner/work/_actions/pmeier/pytest-results-action/v0.6.0/dist/index.js:7247:19)
    at async main (/home/runner/work/_actions/pmeier/pytest-results-action/v0.6.0/dist/index.js:7614:3)

Node.js v20.8.1

That is from this workflow run: https://github.com/yrro/rsync.net-exporter/actions/runs/8691513741/job/23833948744

With this JUnit XML file: JUnit merged results.zip

pmeier commented 4 months ago

Sorry for the delay. I'll take a look.

pmeier commented 4 months ago

The issue is that for some reason you have two test suites in there and all the examples I had so far only had one. I need to look into your workflow how that happened.

pmeier commented 4 months ago

It seems you are merging test results together. That would explain multiple test suites. Is that necessary for your use case? Otherwise, this action supports multiple inputs.

pmeier commented 1 month ago

Fix is available using version v0.7.0.