Skip to content

Commit

Permalink
Merge pull request #226 from infection/feature/html-report-new
Browse files Browse the repository at this point in the history
Add information about HTML logger usage with generated example
  • Loading branch information
maks-rafalko committed Jan 8, 2022
2 parents 9cc3756 + a427f2a commit 217e948
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/guide/command-line-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ infection.phar --logger-github --git-diff-filter=A

Here is [a real example](https://github.com/infection/infection/blob/bef65fc22faa200edd367ffe12596905947a2a93/.github/workflows/mt-annotations.yaml#L50-L52) how Infection uses it itself.

### `--logger-html`

This option is used to provide a path to the generated HTML Report:

```angular2html
infection.phar --logger-html='mutation-report.html'
```

After Infection completes its job, the `mutation-report.html` file will be generated with HTML report ([example](/static/html-report-example.html)).

Takes precedence over `logger.html` setting inside `infection.json` file. If you want to always generate HTML report, it's better to configure it inside `infection.json`, see [here](/guide/usage.html).

### `--skip-initial-tests`

If you have already run the test suite to ensure it is passing, and you are providing coverage using `--coverage` then you can use this option to increase performance by not running the entire test suite again.
Expand Down
2 changes: 2 additions & 0 deletions src/guide/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The first time you run Infection for your project, it will ask you several quest
"timeout": 10,
"logs": {
"text": "infection.log",
"html": "infection.html",
"summary": "summary.log",
"json": "infection-log.json",
"perMutator": "per-mutator.md",
Expand Down Expand Up @@ -80,6 +81,7 @@ You can commit it to the VCS and, if necessary, override it locally by creating
* `timeout` - the maximum allowed time for mutated processes to run, in whole seconds, before they are considered a timeout. Make sure to set it to higher value than your tests are executed in seconds to avoid false-positives.
* `logs`
* `text` - human-readable text log file. Must see to understand what is going on during mutation process.
* `html` - human-readable report, similar to PHPUnit HTML report. Based on [Stryker Elements](https://stryker-mutator.io/blog/one-mutation-testing-html-report/). See [an example](/static/html-report-example.html).
* `summary` - summary log file, which will only display the amount of mutants per category, (Killed, Errored, Escaped, Timed Out, [Skipped](/2020/08/18/whats-new-in-0.17.0/#Skip-S-mutations-that-are-over-specified-time-limit), and Not Covered)
* `json` - machine-readable file in JSON format. Can be programmatically analyzed. In addition to general stats, contains original, mutated code, diff and test framework output for each Mutant.
* `perMutator` - a markdown file which will give a break-down of the effectiveness of each mutator.
Expand Down
19 changes: 19 additions & 0 deletions themes/infection/source/static/html-report-example.html

Large diffs are not rendered by default.

0 comments on commit 217e948

Please sign in to comment.