You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -362,6 +368,13 @@ Output to the shell is the same as running the command `mix coveralls` (to suppr
362
368
363
369
Output reports are written to `cover/excoveralls.xml` by default, however, the path can be specified by overwriting the `"output_dir"` coverage option.
364
370
371
+
### [mix coveralls.cobertura] Show coverage as Cobertura report
372
+
This task displays coverage information at the source-code level formatted as a [Cobertura](https://cobertura.github.io/cobertura/) document.
373
+
The report follows a format supported by [Gitlab](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) code coverage visualization.
374
+
Output to the shell is the same as running the command`mix coveralls` (to suppress this output, add `"print_summary": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.
375
+
376
+
Output reports are written to `cover/cobertura.xml` by default, however, the path can be specified by overwriting the `"output_dir"` coverage option.
377
+
365
378
### [mix coveralls.lcov] Show coverage as lcov report (Experimental)
366
379
This task displays coverage information at the line level formatted as a lcov.
367
380
The report follows a format supported by several code coverage services like VSCode extension(`ryanluker.vscode-coverage-gutters`).
@@ -432,6 +445,9 @@ to `false`:
432
445
- When used in conjunction with `minimum_coverage`, overall project coverage is checked first before individual file coverages are checked.
433
446
- `html_filter_full_covered`
434
447
- A boolean, when `true` files with 100% coverage are not shown in the HTML report. Default to `false`.
448
+
- `floor_coverage`
449
+
- A boolean, when `false` coverage values are ceiled instead of floored, this means that a project with some lines
450
+
that are not covered can still have a total 100% coverage. Default to `true`.
435
451
436
452
Example configuration file:
437
453
@@ -461,6 +477,8 @@ Example configuration file:
461
477
}
462
478
```
463
479
480
+
## Other Considerations
481
+
464
482
### Ignore Lines
465
483
466
484
Use comments `coveralls-ignore-start` and `coveralls-ignore-stop` to ignore certain lines from code coverage calculation.
ExCoveralls can include `.coverdata` files in the result of the current test run through the `--import-cover` flag. This can be used to include coverage data from partitioned tests or integration tests that may run in a subprocess, for instance.
525
+
526
+
Coverage data is generated when running `mix test --cover`, optionally with the `--export-coverage` flag to specify an output name.
527
+
528
+
```shell
529
+
$ mix test --only integration --cover --export-coverage integration-coverage
530
+
Excluding tags: [:test]
531
+
Including tags: [:integration]
532
+
... test run omitted ...
533
+
# Coverage data written to cover/integration-coverage.coverdata
534
+
535
+
# Report coverage, do not run integration tests
536
+
$ mix coveralls --exclude integration
537
+
Excluding tags: [:integration]
538
+
... test run omitted ...
539
+
540
+
----------------
541
+
COV FILE LINES RELEVANT MISSED
542
+
...
543
+
[TOTAL] 80.2% # <-- This result does not include coverage from integration tests
544
+
----------------
545
+
546
+
# Report coverage, do not run integration tests, but include previously written coverdata
[TOTAL] 95.3% # <-- This result now includes coverage from integration tests
555
+
----------------
556
+
```
557
+
558
+
Coverage data is imported after tests are run.
559
+
560
+
See the `mix test` [Coverage documentation](https://hexdocs.pm/mix/Mix.Tasks.Test.html#module-coverage) for more information on `.coverdata`.
561
+
562
+
### Configuring HTTP Options in ExCoveralls
563
+
564
+
You can customize the HTTP options used by [`:httpc`](https://www.erlang.org/doc/man/httpc.html) when posting results. The example below shows how to specify a custom `cacertfile`:
By default, ExCoveralls uses the `cacertfile` from [`castore`](https://hexdocs.pm/castore/api-reference.html) when the dependency is installed. If it's not available and you're running Erlang `25` or later, the system will attempt to use the OS certificates via [`:public_key.cacerts_load/0`](https://www.erlang.org/doc/man/public_key.html#cacerts_load-0).
583
+
504
584
### Notes
505
585
- If mock library is used, it will show some warnings during execution.
0 commit comments