Skip to content

test(azure): cover queue JSON validation - #10876

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-10861-cloud-provider-coverage
Aug 28, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-10861-cloud-provider-coverage

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Part of #10861.

The Azure Queue JSON adapter tests used legacy category traits, so the Azure Storage coverage partition selected none of them. This change adds first-class suite, provider, and area traits so the existing credential-free tests contribute to provider coverage, then covers unsupported envelope versions, malformed required fields and types, and invalid JSON.

Targeted coverage impact for AzureQueueJsonDataAdapter:

Scope Before After
Class line coverage 90.95% 93.97%
Class branch coverage 78.41% 86.36%
TryDeserializeCompactJson line coverage 87.50% 100%
TryDeserializeCompactJson branch coverage 62.50% 83.33%
GetRequiredProperty line coverage 66.67% 100%
GetRequiredProperty branch coverage 50% 100%

The canonical Azure Storage CI query now selects all 29 adapter test cases instead of zero. These tests run without credentials or Azurite.

Remaining #10861 scope includes DynamoDB mutation/configuration and reminder parsing, Azure table/blob/queue error paths, and focused Google, Redis, and Cassandra gaps.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings August 27, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs — This test class now has Suite/Provider/Area traits but no longer has the legacy Category traits…
What changed in this PR

Updates Azure Queue JSON adapter tests so they are correctly picked up by Azure provider coverage lanes and expands negative-path validation coverage for compact JSON envelopes.

Changes:

  • Replaces legacy class-level TestCategory("AzureStorage")/TestCategory("Streaming") traits with first-class TestSuite/TestProvider/TestArea traits.
  • Adds new BVT test cases covering unsupported compact envelope versions, malformed required fields/types, and invalid JSON parsing.
File Description
test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs Adds provider/suite/area traits and expands negative-path JSON envelope validation tests

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 28, 2026 01:02
@ReubenBond
ReubenBond force-pushed the rb-10861-cloud-provider-coverage branch from bac0867 to e671508 Compare August 28, 2026 01:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity · 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs — Asserting the full exception message makes the test brittle and currently this is the only…
Pre-existing issues (1)
Severity Finding
Medium severity test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs — This test class now has Suite/Provider/Area traits but no longer has the legacy Category traits… View comment
Suppressed comments (2)

test/Extensions/Orleans.Azure.Tests/Streaming/AzureQueueJsonDataAdapterTests.cs:24

  • This file now uses the new suite/provider/area traits, but it removed the legacy AzureStorage/Streaming TestCategory tags which are still used across Orleans.Azure.Tests for filtering (e.g., test/Extensions/Orleans.Azure.Tests/AzureClientOptionsTests.cs:6 and Streaming/AzureQueueAdapterTests.cs:17). Keeping those categories in addition to TestSuite/TestProvider/TestArea preserves existing workflows and aligns with the project’s established test-tagging pattern.
    [Collection(TestEnvironmentFixture.DefaultCollection)]
    [TestSuite("BVT")]
    [TestProvider("AzureStorage")]
    [TestArea("Streaming")]

test/Extensions/Orleans.Azure.Tests/Streaming/AzureQueueJsonDataAdapterTests.cs:225

  • Same here: asserting the full exception message (including exact enum casing/article) makes these validation tests more fragile than necessary. Using Assert.Contains provides coverage of the intended branch while allowing the error text to be clarified later.
            var exception = Assert.Throws<InvalidDataException>(
                () => jsonAdapter.FromQueueMessage(message, sequenceId: 0));

            Assert.Equal(expectedMessage, exception.Message);
        }

Comment thread test/Extensions/Orleans.Azure.Tests/Streaming/AzureQueueJsonDataAdapterTests.cs Outdated
Copilot AI review requested due to automatic review settings August 28, 2026 04:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: None

Issues resolved since last review (2)
Severity Finding
Low severity test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs — Asserting the full exception message makes the test brittle and currently this is the only… View resolved comment
Medium severity test/​Extensions/​Orleans.Azure.Tests/​Streaming/​AzureQueueJsonDataAdapterTests.cs — This test class now has Suite/Provider/Area traits but no longer has the legacy Category traits… View resolved comment

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

78.67% line coverage - 99,603 / 126,605 lines

Coverage details

@ReubenBond
ReubenBond merged commit 608e516 into dotnet:main Aug 28, 2026
76 checks passed
@ReubenBond
ReubenBond deleted the rb-10861-cloud-provider-coverage branch August 28, 2026 06:52
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants