Expand code coverage across all test pipelines - #3790
Open
aaronburtle wants to merge 16 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
TestCategoryfor 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Closes #3648
Why make this change?
What is this change?
How was this tested?
Sample Request(s)
N/A