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

Report mutation test coverage of proposed changes #346

Merged
merged 28 commits into from
Nov 30, 2022

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Nov 12, 2022

Suggested commit message:

Report mutation test coverage of proposed changes (#346)

Thanks to a free Arcmutate OSS license, GitHub Actions now runs Pitest against
files changed in the context of a PR. 

While there, update Pitest's configuration to ignore Refaster rule collection
classes, as mutations of those classes will not impact the associated unit
tests.

See:
- https://www.arcmutate.com
- https://pitest.org

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
See https://pitest.org/

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
tech.picnic.errorprone.bugpatterns.PrimitiveComparison 1 1

See https://pitest.org/

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
tech.picnic.errorprone.bugpatterns.PrimitiveComparison 1 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed, or the full report under Checks -> Mutation testing.

1 similar comment
@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
tech.picnic.errorprone.bugpatterns.PrimitiveComparison 1 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed, or the full report under Checks -> Mutation testing.

@github-actions
Copy link

  • Surviving mutants in this change: 2
  • Killed mutants in this change: 2
class surviving killed
tech.picnic.errorprone.bugpatterns.PrimitiveComparison 2 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

  • Surviving mutants in this change: 2
  • Killed mutants in this change: 2
class surviving killed
tech.picnic.errorprone.bugpatterns.PrimitiveComparison 2 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member Author

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Before reviewing this PR, consider reading the corresponding blog post.

.github/workflows/pitest-update-pr.yml Show resolved Hide resolved
pom.xml Show resolved Hide resolved
@Stephan202 Stephan202 requested a review from rickie November 12, 2022 19:45
@Stephan202 Stephan202 added this to the 0.6.0 milestone Nov 12, 2022
@Stephan202 Stephan202 marked this pull request as ready for review November 12, 2022 19:45
@rickie rickie added the chore A task not related to code (build, formatting, process, ...) label Nov 18, 2022
Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

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

Started reviewing this one, cool stuff!

Added a commit.

This might break things, let's see later when testing the changes 👀.

@@ -0,0 +1,7 @@
#Licence file for pitest extensions
Copy link
Member

Choose a reason for hiding this comment

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

We use License everywhere with a "s", let's see if that works here as well.

.github/workflows/pitest-analyze-pr.yml Show resolved Hide resolved
- name: Run Pitest
run: mvn test pitest:mutationCoverage -DargLine.xmx=2048m -Dverification.skip -Dfeatures="+GIT(from[HEAD~1]), +gitci"
- name: Aggregate Pitest reports
run: mvn pitest-git:aggregate -DtrailingText="Mutation testing report by [Pitest](https://pitest.org/). Review any surviving mutants by inspecting the line comments under [_Files changed_](${{ github.event.number }}/files)."
Copy link
Member

Choose a reason for hiding this comment

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

Seems fun to me to add some values for killedEmoji and mutantEmoji. Will propose something 👀.

Relevant documentation here.

@rickie rickie requested a review from Badbond November 19, 2022 13:38
@rickie rickie force-pushed the sschroevers/configure-arcmutate branch from db9c60c to 649066f Compare November 19, 2022 13:39
@rickie
Copy link
Member

rickie commented Nov 19, 2022

Rebased :).

(Ouch, my bad, I think not rebasing was a deliberate choice, seeing the commits and comments after the commits. Sorry 😞).

Clicking the commits shows the comments on the specific commits, that might help.

Copy link
Member Author

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

I'll let you do the revert and test the other changes 🙃

Comment on lines 1 to 7
#License file for pitest extensions
#Mon Nov 07 08:41:17 GMT 2022
expires=07/11/2023
keyVersion=1
signature=MhZxMbnO6UovNfllM0JuVWkZyvRT3/G5o/uT0Mm36c7200VpZNVu03gTAGivnl9W5RzvZhfpIHccuQ5ctjQkrqhsFSrl4fyqPqu3y5V2fsHIdFXP/G72EGj6Kay9ndLpaEHalqE0bEwxdnHMzEYq5y3O9vUPv8MhUl57xk+rvBo\=
packages=tech.picnic.errorprone.*
type=OSSS
Copy link
Member Author

Choose a reason for hiding this comment

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

@rickie following your last commit the codes doesn't work anymore; the plugin looks for the exact original file. Now all analysis is skipped. From the logs:

Licenced for evaluation and demonstration purposes only.
Expires: 2023-09-20
For use with packages: com.example.*

# uploads the results. The associated PR is subsequently updated by the
# `pitest-update-pr.yml` workflow. See https://blog.pitest.org/oss-pitest-pr/
# for details.
name: "Mutation testing: analysis"
Copy link
Member Author

Choose a reason for hiding this comment

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

I had that : analysis suffix in an earlier commit, and I removed it on purpose, IIRC. Something to do with how the result is displayed in the GitHub UI. (But would have to revert the last commit to see how/what.)

Suggested change
name: "Mutation testing: analysis"
name: "Mutation testing"

@@ -0,0 +1,7 @@
#License file for pitest extensions
Copy link
Member Author

Choose a reason for hiding this comment

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

To be sure: I'd also revert the change to this file. It doesn't follow our standards anyway (missing dot at end of sentence, auto-generated timestamp), so I'd rather keep it exactly as provided.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or we should replace all comments with something like:

# Arcmutate license for Error Prone Support, requested by sending an email to
# [email protected].

(Assuming the plugin doesn't care about the comments 👀)

@rickie rickie force-pushed the sschroevers/configure-arcmutate branch from bfcbc3b to c13fd6d Compare November 24, 2022 12:46
@github-actions
Copy link

  • Surviving mutants in this change: 2
  • Killed mutants in this change: 2
class surviving killed
🧟tech.picnic.errorprone.bugpatterns.PrimitiveComparison 2 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

  • Surviving mutants in this change: 2
  • Killed mutants in this change: 2
class surviving killed
🧟tech.picnic.errorprone.bugpatterns.PrimitiveComparison 2 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@github-actions
Copy link

Looks good. All 2 mutations in this change were killed.

class surviving killed
🎉tech.picnic.errorprone.bugpatterns.PrimitiveComparison 0 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

Looks good. All 2 mutations in this change were killed.

class surviving killed
🎉tech.picnic.errorprone.bugpatterns.PrimitiveComparison 0 2

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

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

Added a commit. Also reverted the test changes.

The setup looks good to me, very cool to have this as part of the build 😄.

Doubting a little about the suggested commit message, we could provide some more information about Arcmutate and the setup we now have. I'm thinking there is a reason that you kept it high-level, so first asking whether there is a particular reason for it 👀 @Stephan202.

pom.xml Show resolved Hide resolved
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
Copy link
Member

Choose a reason for hiding this comment

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

Here we should use the same version as in the existing workflow 17.0.4, right?

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202
Copy link
Member Author

Latest changes LGTM! Also updated the suggested commit message. PTAL :)

@rickie
Copy link
Member

rickie commented Nov 26, 2022

Nice, looks splendid 😄!

Copy link
Member

@Badbond Badbond left a comment

Choose a reason for hiding this comment

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

Looking good. Nice suggested commit message too. Didn't dive to deep into all the possbile configuration to see if we can improve further. I've got two comments, but will approve nonetheless as they are not blocking this PR for me.

.github/workflows/pitest-analyze-pr.yml Show resolved Hide resolved
.github/workflows/pitest-analyze-pr.yml Show resolved Hide resolved
@Stephan202 Stephan202 force-pushed the sschroevers/configure-arcmutate branch from 7b609a5 to 1cc5e8c Compare November 29, 2022 18:30
@rickie rickie changed the title Compute mutation test coverage of proposed changes Report mutation test coverage of proposed changes Nov 30, 2022
@rickie rickie merged commit 3303283 into master Nov 30, 2022
@rickie rickie deleted the sschroevers/configure-arcmutate branch November 30, 2022 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task not related to code (build, formatting, process, ...)
Development

Successfully merging this pull request may close these issues.

3 participants