k1LoW / octocov

octocov is a toolkit for collecting code metrics (code coverage, code to test ratio, test execution time and your own custom metrics).
344 stars 21 forks source link

Always count by LOC when merging multiple coverage. #395

Closed k1LoW closed 3 months ago

k1LoW commented 3 months ago

Fix: https://github.com/k1LoW/octocov/issues/394

github-actions[bot] commented 3 months ago

Code Metrics Report

main (96ae31c) #395 (bd137e1) +/-
Coverage 50.7% 50.6% -0.1%
Code to Test Ratio 1:0.5 1:0.5 +0.0
Test Execution Time 23s 24s +1s
Details ``` diff | | main (96ae31c) | #395 (bd137e1) | +/- | |---------------------|----------------|----------------|-------| - | Coverage | 50.7% | 50.6% | -0.1% | | Files | 53 | 53 | 0 | | Lines | 3780 | 3780 | 0 | - | Covered | 1919 | 1916 | -3 | + | Code to Test Ratio | 1:0.5 | 1:0.5 | +0.0 | | Code | 7417 | 7417 | 0 | + | Test | 4404 | 4415 | +11 | - | Test Execution Time | 23s | 24s | +1s | ```

Code coverage of files in pull request scope (100.0% → 87.0%)

Files Coverage +/-
coverage/merge.go 87.0% -13.0%

Benchmark-0 (this is custom metrics test)

main (96ae31c) #395 (bd137e1) +/-
Number of iterations 1000 1000 0
Nanoseconds per iteration 676.5 ns/op 676.5 ns/op 0 ns/op
Metadata | | [main](https://github.com/k1LoW/octocov/tree/main) ([96ae31c](https://github.com/k1LoW/octocov/commit/96ae31c95a26e0954aa6d6ec092b0df96f5573b5)) | [#395](https://github.com/k1LoW/octocov/pull/395) ([bd137e1](https://github.com/k1LoW/octocov/commit/bd137e1b4b504290ea22ea59306d757fc96e56f8)) | |------------|-------------------------------------------------------------------------------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------------:| | **GOOS** | darwin | darwin | | **GOARCH** | amd64 | amd64 |

Benchmark-1 (this is custom metrics test)

main (96ae31c) #395 (bd137e1) +/-
Number of iterations 1500 1500 0
Nanoseconds per iteration 1345 ns/op 1345 ns/op 0 ns/op
Metadata | | [main](https://github.com/k1LoW/octocov/tree/main) ([96ae31c](https://github.com/k1LoW/octocov/commit/96ae31c95a26e0954aa6d6ec092b0df96f5573b5)) | [#395](https://github.com/k1LoW/octocov/pull/395) ([bd137e1](https://github.com/k1LoW/octocov/commit/bd137e1b4b504290ea22ea59306d757fc96e56f8)) | |------------|-------------------------------------------------------------------------------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------------:| | **GOOS** | darwin | darwin | | **GOARCH** | amd64 | amd64 |

Reported by octocov