Skip to content

Make the coverage.config obj exclusion match on Linux - #55

Merged
davidnmbond merged 2 commits into
mainfrom
fix/coverage-obj-pattern
Oct 3, 2026
Merged

davidnmbond merged 2 commits into
mainfrom
fix/coverage-obj-pattern

Conversation

@davidnmbond

@davidnmbond davidnmbond commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The coverage.config source exclusion for obj was written with Windows-only path separators, so on our Linux CI runners it matched nothing, and source-generated files under obj/ (Refit clients, logging generators) counted towards coverage. Measured before the fix: Meraki.Api's coverage report included 29 such files, PanoramicData.OData.Client's 1.

The pattern is now .*[\\/]obj[\\/].*, which matches either separator, so it works on both the Linux runners and Windows workstations.

Tracked on OPS-157454.

🤖 Generated with Claude Code

The source exclusion was written with Windows path separators (.*\obj\.*),
so on the Linux CI runners it matched nothing, and source-generated files
under obj/ (Refit clients, logging generators) were counted towards coverage.
[\/] matches either separator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (329893b) 3023 2543 84.12%
Head commit (44e969f) 3023 (+0) 2543 (+0) 84.12% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#55) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

… Windows

The obj source exclusion was written with Windows-only path separators, so on
the Linux CI runners it matched nothing, and source-generated files under obj/
(Refit clients, logging generators) were counted towards coverage. The pattern
now uses a character class matching either separator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@davidnmbond
davidnmbond merged commit 75c5ab2 into main Oct 3, 2026
6 checks passed
@davidnmbond
davidnmbond deleted the fix/coverage-obj-pattern branch October 3, 2026 14:56

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

While this PR correctly identifies the need for cross-platform path separators in coverage.config, the implementation is incomplete. The updated regex for the obj directory fails to account for relative paths starting with 'obj/', and the Benchmarks exclusion was left unchanged, leaving it broken for Linux environments. Although Codacy reports the PR is up to standards, these logic gaps will prevent the exclusions from working as intended on Linux CI runners.

About this PR

  • The exclusion pattern for the Benchmarks directory still uses Windows-specific backslashes and a potentially incorrect regex sequence (\B), which will likely fail on Linux and might not behave as intended even on Windows.

Test suggestions

  • Verify that files in the obj/ directory are excluded from coverage on Linux runners.
  • Verify that files in the obj/ directory are excluded from coverage on Windows workstations.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that files in the `obj/` directory are excluded from coverage on Linux runners.
2. Verify that files in the `obj/` directory are excluded from coverage on Windows workstations.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

<Sources>
<Exclude>
<Source>.*\obj\.*</Source>
<Source>.*[\\/]obj[\\/].*</Source>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

This pattern requires a preceding separator, meaning it will not match relative paths starting with obj/. To support both absolute and relative paths, allow the start of the string as an alternative to the separator.

Suggested change
<Source>.*[\\/]obj[\\/].*</Source>
<Source>.*([\\/]|^)obj[\\/].*</Source>

<Exclude>
<Source>.*\obj\.*</Source>
<Source>.*[\\/]obj[\\/].*</Source>
<Source>.*\Benchmarks\.*</Source>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Suggestion: The Benchmarks exclusion should be updated to use the same cross-platform path separator pattern as the obj directory to ensure consistency and correct behavior on Linux. Additionally, \B is likely being interpreted as a regex anchor rather than a path component.

Suggested change
<Source>.*\Benchmarks\.*</Source>
<Source>.*[\\/]Benchmarks[\\/].*</Source>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant