Skip to content

Choose a tag to compare

@achedon12 achedon12 released this 08 Oct 13:14
18c86ea

Golem 0.7.0 tells you how good your tests are, not only whether they pass.

Mutation testing. golem mutate changes your code one small mutation at a time (=== into !==, < into <=, true into false…) and runs the tests that cover each line. The mutants nobody notices are the bugs your tests would let through:

  ✗ survived src/HelloWorld.php:110 < → <=
    - if ($event->getFrom()->x < $arenaStart && $event->getTo()->x >= $arenaStart) {
    + if ($event->getFrom()->x <= $arenaStart && $event->getTo()->x >= $arenaStart) {

  Mutation score: 52.9% (9 of 17 mutants caught by the tests)

Flaky tests. --repeat=10 --random-order runs every test several times, shuffled, and lists those that pass in some runs and fail in others. The seed is printed to replay the order.

Plugins side by side. golem compat EssentialsMP libs/Economy.phar runs your tests alone, then with other plugins next to yours (phars, folders or Poggit names), and shows the tests that break and the commands another plugin takes. Every run now warns about command conflicts.

Reports. --report-html writes a self-contained HTML report. In GitHub Actions, comment: true posts a summary on the pull request and keeps it up to date.

Dashboard. Watch mode runs your picked tests again on every save, and the Mutation tab shows the mutants as they are tried.

Everything is in the changelog and the documentation.