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

Add test coverage #116

Merged
merged 6 commits into from
Jan 12, 2024
Merged

Add test coverage #116

merged 6 commits into from
Jan 12, 2024

Conversation

NicMcPhee
Copy link
Member

@NicMcPhee NicMcPhee commented Jan 11, 2024

This adds the relevant bits from the iteration template that tell Gradle to compute and check the Jacoco test coverage stats.

Jacoco won't let us exclude just a method from the test coverage stats; we have to exclude whole classes. It then seemed to make sense to pull the main() method out into a new Main class, and then exclude that class from the code coverage stats.

We then exclude Main.class since it's just the really simple main() method.

I updated the Markdown files to make sure that the they were up-to-date with the refactoring I did here. While I was there I got excited and made several other edits that really had nothing to do with this PR – sorry. 😢 If anyone wants me to separate them out, just say so.

Closes #114

Jacoco won't let us exclude just a method from the test coverage stats; we have to exclude whole classes. It then seemed to make sense to pull the `main()` method out into a new `Main` class, and then exclude that class from the code coverage stats.
This adds the relevant bits from the iteration template that tell Gradle to compute and check the Jacoco test coverage stats.

We exclude `Main.class` since it's just the really simple `main()` method.
@NicMcPhee NicMcPhee self-assigned this Jan 11, 2024
@NicMcPhee NicMcPhee marked this pull request as draft January 11, 2024 20:06
@NicMcPhee NicMcPhee changed the title Add test coverage Add test coverage and code quality checks Jan 11, 2024
@NicMcPhee NicMcPhee changed the title Add test coverage and code quality checks Add test coverage Jan 11, 2024
@NicMcPhee NicMcPhee marked this pull request as ready for review January 11, 2024 22:19
This got a bit away from me. My real goal was just to make sure that the documentation was consistent with the changes I made to add test coverage, but I ended up making a number of other changes as well. Sorry.
The old way was deprecated, but this makes the last deprecation warning go away.
Copy link
Member

@kklamberty kklamberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added one commit here that you may want to check. All else looked good to me!

@NicMcPhee NicMcPhee merged commit 35d82c0 into main Jan 12, 2024
2 checks passed
@NicMcPhee
Copy link
Member Author

Good catch! I had "Merge when ready" turned on, so it already committed, but I'm happy about the change.

@NicMcPhee NicMcPhee deleted the add-test-coverage branch January 12, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test code coverage
2 participants