Skip to content

Expand code coverage across all test pipelines - #3790

Open
aaronburtle wants to merge 16 commits into
mainfrom
dev/aaronburtle/code-coverage-completion
Open

Expand code coverage across all test pipelines#3790
aaronburtle wants to merge 16 commits into
mainfrom
dev/aaronburtle/code-coverage-completion

Conversation

@aaronburtle

Copy link
Copy Markdown
Contributor

Why make this change?

Closes #3648

Why make this change?

  • The rolling coverage dashboard combines results from the unit and database-specific pipelines, but significant provider-specific paths were not covered.
  • This change reduces those gaps across the Unit, MsSql, PostgreSQL, MySQL, DWSQL, and CosmosDB NoSQL pipelines.

What is this change?

  • Adds deterministic behavioral tests across authentication, configuration, MCP tooling, metadata providers, query builders, query executors, mutations, pagination, serialization, and error handling.
  • Assigns provider-specific tests to their corresponding test categories so coverage is collected by the appropriate database pipeline.
  • Exercises success, validation, authorization, parsing, fallback, and exception paths without changing production behavior.
  • Validates coverage gains against source-compatible pipeline artifacts using a fixed sequence-point universe.
  • Covers all reachable provider-owned coverage gaps; the remaining CosmosDB sequence points are compiler-generated or defensive unreachable paths.
  • This is a test-only change with no REST, GraphQL, CLI, configuration, or runtime API changes.

How was this tested?

  • Integration Tests
  • Unit Tests

Sample Request(s)

N/A

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.

Pull request overview

This PR expands automated test coverage across Data API Builder’s core runtime and provider-specific paths (Unit + database-category pipelines), aligning with the goal of closing coverage gaps called out in #3648 without changing production behavior.

Changes:

  • Adds new unit/integration-style tests that exercise previously uncovered branches in query structures/builders/executors, metadata providers, config converters/validators, telemetry helpers, and MCP tooling.
  • Introduces provider-scoped test coverage via TestCategory for PostgreSQL/MySQL/DWSQL/CosmosDB NoSQL to ensure coverage is attributed to the correct pipeline.
  • Extends existing test suites with additional edge-case/exception-path assertions (auth, parsing, pagination, error mapping, serialization).

Reviewed changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Service.Tests/UnitTests/TypeHelperTests.cs Extends type-mapping and value extraction test coverage.
src/Service.Tests/UnitTests/SqlQueryStructuresModelTests.cs Adds equality/guard/accessor coverage for query structure model types.
src/Service.Tests/UnitTests/SqlQueryStructureHelperTests.cs Adds coverage for SqlQueryStructure helper/private-path behavior via reflection.
src/Service.Tests/UnitTests/SqlQueryExecutorUnitTests.cs Extends MsSqlQueryExecutor coverage for statement IDs, connection creation, and managed identity/OBO paths.
src/Service.Tests/UnitTests/SqlQueryEngineHelperTests.cs Adds coverage for SqlQueryEngine internal execution helpers and result-shape handling.
src/Service.Tests/UnitTests/SqlPaginationUtilUnitTests.cs Expands pagination utility coverage (cursor creation, forwarded headers, querystring formatting, JSON scalar resolution).
src/Service.Tests/UnitTests/RuntimeOptionsConverterCoverageTests.cs Adds coverage for runtime options JSON conversion (GraphQL/REST/file sink).
src/Service.Tests/UnitTests/RuntimeConfigValidatorUnitTests.cs Adds validator-path coverage (file sink edge cases, embeddings validation, MCP/stored-proc validation, relationship validation).
src/Service.Tests/UnitTests/RuntimeConfigHelperTests.cs Adds coverage for RuntimeConfig defaults and mapping helper behavior.
src/Service.Tests/UnitTests/PureUtilityCoverageTests.cs Adds focused coverage for utility helpers (log level conversion, change token, validator util, metadata type converter).
src/Service.Tests/UnitTests/PostgresQueryBuilderHelperTests.cs Adds PostgreSQL query builder helper coverage for not-implemented/error paths.
src/Service.Tests/UnitTests/PostgreSqlQueryExecutorHelperTests.cs Adds PostgreSQL executor helper coverage for result-set parsing error paths.
src/Service.Tests/UnitTests/PostgreSqlMetadataProviderHelperTests.cs Adds PostgreSQL metadata provider helper coverage (search path, array UDT metadata, init errors).
src/Service.Tests/UnitTests/PostgreSqlDbExceptionParserHelperTests.cs Adds PostgreSQL transient/status mapping coverage.
src/Service.Tests/UnitTests/MySqlQueryExecutorHelperTests.cs Adds MySQL executor helper coverage (MI token behavior, result-set parsing error paths).
src/Service.Tests/UnitTests/MySqlQueryBuilderHelperTests.cs Adds MySQL query builder helper coverage for not-implemented paths.
src/Service.Tests/UnitTests/MySqlMetadataProviderHelperTests.cs Adds MySQL metadata provider helper coverage for unsupported schema and not-implemented paths.
src/Service.Tests/UnitTests/MySqlDbExceptionParserHelperTests.cs Adds MySQL transient/status mapping coverage.
src/Service.Tests/UnitTests/MultipleCreateOrderHelperEdgeTests.cs Adds edge-case coverage for multiple-create ordering and field/backing-column mapping.
src/Service.Tests/UnitTests/MsSqlQueryBuilderHelperTests.cs Adds MSSQL query builder coverage for trigger/autogen PK and upsert branches.
src/Service.Tests/UnitTests/McpTelemetryTests.cs Extends telemetry helper coverage for activity tags and error details.
src/Service.Tests/UnitTests/McpStdioServerContentBlockTests.cs Extends MCP stdio server helper coverage for content block coercion and safe string/id parsing.
src/Service.Tests/UnitTests/McpLogNotificationTests.cs Extends MCP logger/provider coverage (scopes, disabled behavior, formatter validation, disposal behavior).
src/Service.Tests/UnitTests/GraphQLFilterParserUnitTests.cs Adds filter/parser helper coverage (middleware HttpContext extraction, operand chaining, IN preprocessing).
src/Service.Tests/UnitTests/ExecutionHelperScalarTests.cs Adds coverage for scalar coercion from JSON leaf values (numeric/text/temporal, error mapping).
src/Service.Tests/UnitTests/EntitySourceConverterTests.cs Adds coverage for legacy/modern parameter deserialization and round-trip behavior.
src/Service.Tests/UnitTests/EntityHealthOptionsConverterTests.cs Adds coverage for entity health config conversion, defaults, and invalid inputs.
src/Service.Tests/UnitTests/EntityApiOptionsConverterCoverageTests.cs Adds coverage for entity REST/GraphQL options conversion and edge shapes.
src/Service.Tests/UnitTests/EmbeddingTelemetryHelperTests.cs Adds coverage for embedding metrics and trace activity tagging.
src/Service.Tests/UnitTests/EmbeddingsOptionsConverterTests.cs Extends embeddings options converter coverage for invalid nested shapes and serialization behavior.
src/Service.Tests/UnitTests/DwSqlQueryBuilderHelperTests.cs Adds DWSQL query builder helper coverage for join optimization and internal helpers.
src/Service.Tests/UnitTests/DmlToolsConfigConverterTests.cs Extends DML tools config converter coverage for null/unexpected token shapes.
src/Service.Tests/UnitTests/DeserializationVariableReplacementSettingsTests.cs Extends AKV secret name validation coverage via reflection.
src/Service.Tests/UnitTests/DatabaseObjectUnitTests.cs Adds coverage for database object source definitions, FK/relationship equality, and role-based column resolution.
src/Service.Tests/UnitTests/CosmosSqlMetadataProviderHelperTests.cs Adds Cosmos SQL metadata provider helper coverage (unsupported members, schema parsing, mapping, partition keys).
src/Service.Tests/UnitTests/CosmosSamplerHelperTests.cs Adds Cosmos sampler executor coverage for success/error response processing.
src/Service.Tests/UnitTests/CosmosQueryStructureHelperTests.cs Adds Cosmos query structure helper coverage (aliases, fragment expansion, order-by parsing).
src/Service.Tests/UnitTests/CosmosQueryEngineExecutionHelperTests.cs Adds Cosmos query engine execution helper coverage (paging, continuation tokens, ID+PK query behavior).
src/Service.Tests/UnitTests/CosmosQueryBuilderHelperTests.cs Adds Cosmos query builder coverage for predicate/operand resolution and EXISTS building.
src/Service.Tests/UnitTests/CosmosODataVisitorHelperTests.cs Adds Cosmos OData visitor helper coverage for operator mapping, null handling, and parameter capture.
src/Service.Tests/UnitTests/CosmosClientProviderHelperTests.cs Adds Cosmos client provider coverage for initialization, parsing, and AAD token credential behavior.
src/Service.Tests/UnitTests/ConfigureJwtBearerOptionsTests.cs Adds coverage for JWT bearer option configuration across modes/providers.
src/Service.Tests/UnitTests/ConfigObjectModelCoverageTests.cs Adds coverage for config object model default behaviors, fallbacks, and error paths.
src/Service.Tests/UnitTests/BaseSqlQueryStructureHelperTests.cs Adds coverage for base SQL structure parsing, join predicate failures, and contextual error messaging.
src/Service.Tests/UnitTests/AutoentityConverterCoverageTests.cs Adds coverage for autoentity converters and invalid input shapes.
src/Service.Tests/UnitTests/ApplicationNameTelemetryTests.cs Extends decode/encode coverage for truncated/newer payloads and alphabet decoding.
src/Service.Tests/Mcp/McpServerConfigurationTests.cs Adds coverage for MCP server option configuration.
src/Service.Tests/Mcp/McpResponseBuilderTests.cs Extends JSON value conversion coverage (typed vs raw serialization).
src/Service.Tests/Mcp/McpMetadataHelperTests.cs Extends metadata resolution coverage for factory exception mapping.
src/Service.Tests/Mcp/McpAuthorizationHelperTests.cs Extends authorization helper coverage for column authorization decisions and empty-column behavior.
src/Service.Tests/Mcp/McpArgumentParserTests.cs Extends MCP argument parsing coverage for early failures and parameter conversion.
src/Service.Tests/Mcp/DescribeEntitiesFilteringTests.cs Extends describe-entities tool coverage for disabled/canceled/missing entity filters.
src/Service.Tests/Mcp/DeleteRecordToolUnitTests.cs Adds coverage for delete tool behavior, authorization, key validation, and error mapping.
src/Service.Tests/Mcp/CreateRecordToolUnitTests.cs Adds coverage for create tool behavior, authorization, result mapping, and exception handling.
src/Service.Tests/GraphQLBuilder/GraphQLUtilsTests.cs Extends GraphQL utility coverage for scalar detection, relationship helpers, and directive helpers.
src/Service.Tests/Authorization/REST/RestAuthorizationHandlerUnitTests.cs Extends REST authorization handler coverage for multi-requirement rejection, HTTP verb validation, and stored-proc checks.
src/Service.Tests/Authorization/AuthorizationResolverUnitTests.cs Adds null-guard coverage for role lookup helper.

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

Comment thread src/Service.Tests/UnitTests/EntityHealthOptionsConverterTests.cs
@aaronburtle aaronburtle changed the title Dev/aaronburtle/code coverage completion Expand code coverage across all test pipelines Aug 29, 2026
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.

[Fundamentals] Code coverage

2 participants