From cb045b8ef3959f0ee225d65857b665dfc1508df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deluan=20Quint=C3=A3o?= Date: Tue, 1 Sep 2026 23:02:15 -0400 Subject: [PATCH] ci: exclude tests/ from the coverage report on pull requests too (#6070) The exclusion only worked on master. Coverage profiles name files by import path; octocov shortens those to repo-relative paths using the checked-out source, but coverage-on-pr.yml sparse-checks-out only .octocov.yml, so the paths stay as github.com/navidrome/navidrome/tests/mock_*.go and 'tests/**' never matched. '**/*_gen.go' matched either way, which is why only the 30 tests/ files leaked. Every pull request since b77fb45 therefore reported ~-3.7% against master: 447 files on the base side, 477 on the pull request side (#6002, #6069). --- .octocov.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.octocov.yml b/.octocov.yml index 467998b51..c4ad10712 100644 --- a/.octocov.yml +++ b/.octocov.yml @@ -8,8 +8,10 @@ coverage: paths: - coverage.out # Not code under test: tests/ holds the mocks and helpers, *_gen.go is generated. + # Both patterns need the '**/' prefix: the comment workflow has no source tree, + # so octocov cannot shorten the profile's import paths to repo-relative ones. exclude: - - 'tests/**' + - '**/tests/**' - '**/*_gen.go' codeToTestRatio: # Needs the pull request's own source, which the comment workflow must not