Skip to content
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

Error: Cannot read properties of undefined (reading 'map') #61

Closed
tm1000 opened this issue May 18, 2024 · 7 comments · Fixed by #62
Closed

Error: Cannot read properties of undefined (reading 'map') #61

tm1000 opened this issue May 18, 2024 · 7 comments · Fixed by #62
Assignees

Comments

@tm1000
Copy link
Member

tm1000 commented May 18, 2024

I am getting an error.

Error: Cannot read properties of undefined (reading 'map')

See https://github.com/cfug/dio/actions/runs/9137019517/job/25139180215

Originally posted by @kuhnroyal in #53 (comment)

@tm1000
Copy link
Member Author

tm1000 commented May 18, 2024

@kuhnroyal can you attach the cobertura.xml file from your workflow here?

@tm1000 tm1000 changed the title I am getting an error. Error: Cannot read properties of undefined (reading 'map') May 18, 2024
@kuhnroyal
Copy link
Contributor

For now I can tell you that my baseline file has no sources, this is probably the problem.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage lines-valid="0" lines-covered="0" line-rate="0" branches-valid="0" branches-covered="0" branch-rate="0" timestamp="1716003335.624" complexity="0" version="5.4.3+1">
  <sources/>
  <packages>
    <package name="dio" line-rate="0" branch-rate="0">
      <classes/>
    </package>
  </packages>
</coverage>

@tm1000
Copy link
Member Author

tm1000 commented May 19, 2024

@kuhnroyal thatll do it. I'll have a fix out later tonight

@tm1000 tm1000 self-assigned this May 19, 2024
tm1000 added a commit that referenced this issue May 19, 2024
@tm1000 tm1000 mentioned this issue May 19, 2024
tm1000 added a commit that referenced this issue May 19, 2024
@tm1000
Copy link
Member Author

tm1000 commented May 19, 2024

@kuhnroyal
Copy link
Contributor

Thanks!

@chrisj-nz
Copy link

@tm1000 I'm facing similar issue with v5.0.1 with parsing cobertura format without <source>
I can see the fix made in the PR, e.g. for function parseClasses: https://github.com/clearlyip/code-coverage-report-action/pull/62/files#diff-b50c1a0f63134152f4ea22bdf1f0af5bd02d0dd2d9c6ee174fe95917cb360688R55 is in the v5.0.1 tag: https://github.com/clearlyip/code-coverage-report-action/blob/v5.0.1/src/reports/cobertura/parser/index.ts#L55

But I don't see any changes between these v5.0 and v5.0.1 tags: v5.0...v5.0.1 and the dist/index.js looks unchanged for function parseClasses on v5.0.1: https://raw.githubusercontent.com/clearlyip/code-coverage-report-action/v5.0.1/dist/index.js and v5: https://raw.githubusercontent.com/clearlyip/code-coverage-report-action/v5/dist/index.js

@tm1000
Copy link
Member Author

tm1000 commented Jul 16, 2024

@chrisj-nz nice catch! Fixed in v.5.1.0 (5.1 because I updated deps)

tm1000 added a commit that referenced this issue Jul 16, 2024
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 a pull request may close this issue.

3 participants