Skip to content

OPS-157454: Group live OData tests as integration and exclude them from CI - #56

Merged
davidnmbond merged 1 commit into
mainfrom
ci/exclude-integration-tests
Oct 4, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
ci/exclude-integration-tests

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Eight test classes (ODataClientIntegrationTests and the seven classes under IntegrationTests/) call
the public services.odata.org sample services over the network, and nothing grouped them, so both
the build job and the coverage job ran them on every push. They now carry
[Trait("Category", "Integration")] and both CI test steps pass
--filter-not-trait "Category=Integration". Offline tests still run in full (762 locally).

Tracked under OPS-157454 (integration tests must not run in CI).

🤖 Generated with Claude Code

…om CI

Eight test classes (ODataClientIntegrationTests and the seven classes under IntegrationTests/) call
the public services.odata.org sample services over the network, and nothing grouped them, so both
the build job and the coverage job ran them on every push. They now carry
[Trait("Category", "Integration")] and both CI test steps pass
--filter-not-trait "Category=Integration". Offline tests still run in full (762 locally).

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

Not up to standards ⛔

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🔴 Coverage ∅ diff coverage · -1.52% coverage variation

Metric Results
Coverage variation ❌ -1.52% coverage variation (-1.00%)
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f12337c) 3023 2543 84.12%
Head commit (97d3b87) 3023 (+0) 2497 (-46) 82.60% (-1.52%)

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 (#56) 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.

@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

The Codacy analysis indicates this PR is not up to standards, primarily due to a significant drop in test coverage. While the objective of excluding external integration tests from CI is sound, the implementation contains critical syntax errors in the GitHub Actions workflow. Specifically, the use of '--filter-not-trait' is invalid for 'dotnet test' and the testing platform.

Additionally, excluding these tests has resulted in a 100% coverage loss for 'ODataClient.ServiceDocument.cs'. This core parsing logic is now unverified in CI. It is recommended to implement unit tests using a mocked 'HttpClient' to restore coverage for this component without reintroducing external network dependencies. These issues should be resolved before merging to maintain build integrity and code quality.

About this PR

  • The exclusion of integration tests has revealed a lack of underlying unit test coverage for core components, specifically in 'ODataClient.ServiceDocument.cs'. While the move to isolate network-dependent tests is correct, core logic parsing must still be validated via unit tests to prevent future regressions.

Test suggestions

  • Verify 'dotnet test' command in CI uses the filter flag
  • Verify the coverage runner command in CI uses the filter flag
  • Confirm all eight mentioned test classes are decorated with the trait
  • Unit tests for ODataClient.ServiceDocument.cs logic using mocked HttpClient to restore coverage
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Unit tests for ODataClient.ServiceDocument.cs logic using mocked HttpClient to restore coverage

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

Comment thread .github/workflows/ci.yml
--coverage-settings PanoramicData.OData.Client.Test/coverage.config
--coverage-output-format cobertura
--coverage-output coverage.cobertura.xml
--filter-not-trait "Category=Integration"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

The '--filter-not-trait' flag is not supported by the testing platform. Use the '--filter' option with a conditional expression to exclude the integration category.

Suggested change
--filter-not-trait "Category=Integration"
--filter "Category!=Integration"

Comment thread .github/workflows/ci.yml
# Integration tests call the public services.odata.org sample services and are run locally, never in CI.
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
run: dotnet test --configuration Release --no-build --verbosity normal --filter-not-trait "Category=Integration"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

The '--filter-not-trait' argument is invalid and will cause the filter to be ignored or the command to fail. Use the standard '--filter' option instead:

Suggested change
run: dotnet test --configuration Release --no-build --verbosity normal --filter-not-trait "Category=Integration"
run: dotnet test --configuration Release --no-build --verbosity normal --filter "Category!=Integration"

Additionally, excluding these tests has dropped the coverage of 'ODataClient.ServiceDocument.cs' from 87.5% to 0%. Consider implementing unit tests using a mocked HttpClient or HttpMessageHandler to test ServiceDocument parsing with static XML payloads, ensuring this logic is validated in CI without requiring live OData services.

See Coverage in Codacy

@davidnmbond
davidnmbond merged commit 6463cb5 into main Oct 4, 2026
9 of 11 checks passed
@davidnmbond
davidnmbond deleted the ci/exclude-integration-tests branch October 4, 2026 11:15
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