hpi-swa / smalltalkCI

Framework for testing Smalltalk projects with GitHub Actions, GitLab CI, Travis CI, AppVeyor, and others.
MIT License
94 stars 68 forks source link

Fix targets for coverage testing #571

Closed LinqLover closed 1 year ago

LinqLover commented 1 year ago

This PR fixes the selection and reporting of targets for coverage testing. Concretely, two relevant changes are made:

  1. Fix file paths for coverage reports

    Implement and test proper handling of class-side methods, extension methods, trait methods, and special message selectors.

  2. Honor extension methods of selected packages for coverage testing

Additionally, I updated the documentation on coverage configuration.

Resolves #362.

Disclaimers

I did not yet fix the selection of coverage targets for traits (as noted in the updated documentation). This is currently also broken in Squeak's own TestRunner (and likely in the SUnit implementation of other dialects at all). I have created a second PR (#572) for this but would prefer to merge this separately as it depends on a not-yet-merged change to the Traits package.

To try out

You can use this example repository: SCICodeCoverageExample.zip

If you have no coveralls_build_data.json for testing available (like me), run smalltalkCI in headful mode and set a breakpoint in SCICoverallsWriter>>#export:in: to explore the result of codeCoverage coverallsSourceFilesIn: projectDirectory.

Note that the example methods from the trait currently are marked as uncovered, which is a consequence of the limitation I mentioned above. Also, the two nil entries in the list are caused by this limitation. I'm working on it ...


Looking forward to your review! :-)

fniephaus commented 1 year ago

Integrated as part of #575.