Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
- name: Build
run: dotnet build --configuration Release --no-restore

# 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


- name: Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts
Expand Down Expand Up @@ -84,6 +85,7 @@ jobs:
--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"


# continue-on-error: a Codacy outage must not turn a passing test run red. The
# trade-off is that an expired or missing project token fails silently, so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// Uses the TripPin read-write sample service which provides a unique session per request.
/// Note: The TripPin service has specific behavior - entities may not persist across calls.
/// </summary>
[Trait("Category", "Integration")]
public class CrudIntegrationTests : TestBase, IAsyncLifetime
{
private ServiceProvider? _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// <remarks>
/// Initializes a new instance of the test class.
/// </remarks>
[Trait("Category", "Integration")]
public class FluentApiIntegrationTests(ODataClientFixture fixture) : TestBase, IClassFixture<ODataClientFixture>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// <remarks>
/// Initializes a new instance of the test class.
/// </remarks>
[Trait("Category", "Integration")]
public class MetadataIntegrationTests(ODataClientFixture fixture) : TestBase, IClassFixture<ODataClientFixture>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// <remarks>
/// Initializes a new instance of the test class.
/// </remarks>
[Trait("Category", "Integration")]
public class PaginationIntegrationTests(ODataClientFixture fixture) : TestBase, IClassFixture<ODataClientFixture>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// Integration tests for OData V4 query options using the public sample service.
/// Tests $filter, $select, $expand, $orderby, $top, $skip, $count, $search.
/// </summary>
[Trait("Category", "Integration")]
public class QueryOptionsIntegrationTests : TestBase, IClassFixture<ODataClientFixture>
{
private readonly ODataClientFixture _fixture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// <remarks>
/// Initializes a new instance of the test class.
/// </remarks>
[Trait("Category", "Integration")]
public class RawQueryIntegrationTests(ODataClientFixture fixture) : TestBase, IClassFixture<ODataClientFixture>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace PanoramicData.OData.Client.Test.IntegrationTests;
/// Integration tests using the TripPin sample service for advanced OData V4 scenarios.
/// TripPin provides more complex entity relationships and features.
/// </summary>
[Trait("Category", "Integration")]
public class TripPinIntegrationTests : TestBase, IAsyncLifetime
{
private ServiceProvider? _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace PanoramicData.OData.Client.Test;
/// Initializes a new instance of the <see cref="ODataClientIntegrationTests"/> class.
/// </remarks>
/// <param name="fixture">The OData client fixture providing a configured client instance.</param>
[Trait("Category", "Integration")]
public class ODataClientIntegrationTests(ODataClientFixture fixture) : TestBase, IClassFixture<ODataClientFixture>
{

Expand Down
Loading