Skip to content

Add Coverlet PR coverage reporting and cross-database boundary tests - #189

Merged
jogibear9988 merged 10 commits into
masterfrom
codex/coverage-database-boundaries
Sep 23, 2026
Merged

jogibear9988 merged 10 commits into
masterfrom
codex/coverage-database-boundaries

Conversation

@jogibear9988

@jogibear9988 jogibear9988 commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

The test workflow previously verified test assignment but did not measure code coverage or report coverage changes in pull requests. Database tests also left gaps around type capacities, numeric boundaries, parameter binding, and data preservation during schema changes.

This PR adds Coverlet reporting and expands the existing database matrix, with fixes for defects exposed by the new tests.

Coverage reporting

  • Collect Cobertura reports from Unit and all eleven database suites, then merge them into an HTML report and a combined Cobertura artifact.
  • Show line and branch coverage in the PR check summary, including changes in percentage points against a successful workflow run on the exact target commit and branch.
  • Explicitly mark missing or expired baselines as unavailable. The initial successful target-branch run establishes the baseline; artifacts are retained for 90 days.
  • Use read-only GitHub permissions without external coverage services or additional secrets. Coverage is informational, with no minimum threshold and no PR conversation comment.

Expanded tests

  • Add 75 live cases per database across SQLite, SQL Server, PostgreSQL, Oracle, MySQL, MariaDB, Firebird, Db2, Informix, Sybase, and HANA, plus dialect and driver regression cases.
  • Define an explicit schema contract for every MigratorDbType, including rejection of unsupported mappings before DDL execution.
  • Exercise integer extremes, decimal precision and overflow, floating-point values, bounded/fixed/large strings, binary data, NULL/empty/whitespace values, date/time boundaries, defaults, and nullability.
  • Verify that widening and renaming populated columns preserve existing values and NULLs.
  • Document engine-specific semantics and remaining qualification gaps in docs/data-type-boundary-tests.md. Schema mapping tests alone do not establish complete value fidelity for every type.

Provider fixes

  • MySQL/MariaDB: retain ANSI length 256, map maximum ANSI text to LONGTEXT, honor explicit decimal precision/scale, and use DECIMAL(19,4) for Currency.
  • Oracle: preserve four fractional digits in Currency columns, use native BINARY_FLOAT storage and parameters for Single, and report character metadata correctly.
  • SQL Server: use VARBINARY(max) above 8000 bytes and expose numeric precision/scale and fixed-character metadata.
  • Firebird: correct variable/fixed string and bounded binary mappings, and recognize OCTETS as binary in metadata.
  • Shared parameter binding: support Single and SByte values; use SQL NULL for null insert/update values to avoid incorrect binary parameter types.
  • PostgreSQL: bind UInt64 as Decimal, preserve non-UTC timestamp values, and recognize fixed-character metadata.
  • Db2: bind Byte through the supported SMALLINT parameter type.
  • Informix: decode raw TEXT scalar bytes using the database GL_CTYPE codeset to avoid native Unicode read corruption.
  • SQLite: reject UInt64 values above Int64.MaxValue instead of allowing lossy conversion.

These mapping changes affect generated DDL; existing tables are not altered automatically. SQLite UInt64 overflow now fails explicitly.

Validation

  • All 12 matrix jobs and the coverage comparison job passed on head b0be0fe: https://github.com/dotnetprojects/Migrator.NET/actions/runs/35796417995.
  • All 2,117 discovered tests were assigned exactly once across Unit and eleven database suites. No test failures or unexpected skips were tolerated.
  • Combined production line coverage: 78.93% (8,066/10,219). Branch coverage: 72.84% (3,734/5,126). HTML and Cobertura reports are available in the code-coverage artifact.
  • The earlier approximately 44% measurement covered only Unit and SQLite. It is not comparable to the full matrix. The exact PR base commit has no coverage artifact yet, so the PR delta correctly reports N/A instead of inventing a baseline.
  • All 862 locally executable Unit/SQLite tests passed. Coverage-script regression tests, actionlint, and whitespace checks passed.
  • Shared test teardown disposes provider-owned connections even when cleanup fails. Unique per-test Oracle users disable pooling to avoid accumulating server processes.

All changes are committed with detailed English messages. Temporary diagnostics and unsuccessful workarounds were removed; complete large-text assertions remain enabled, including an accented suffix.

Collect Coverlet Cobertura reports in all twelve existing test jobs and
merge the eleven database suites plus Unit into an HTML coverage artifact.
Show line and branch coverage in the PR check summary, comparing against
a successful run on the exact target commit. Report missing or expired
baselines explicitly instead of assuming zero coverage. Keep the workflow
read-only and independent of external coverage services or new secrets.

Add 75 live boundary cases per database across all eleven supported CI
engines, plus 371 dialect and driver regression cases. Cover every
MigratorDbType schema contract, supported integer ranges, decimal precision,
floating-point values, bounded and large strings, fixed-length strings,
binary payloads, NULL and empty values, date/time boundaries, defaults,
nullability, and data preservation during column widening and renaming.
Document native engine differences and remaining qualification gaps.

Fix defects exposed by the new tests:
- Preserve MySQL/MariaDB ANSI length 256 and maximum text capacity.
- Honor MySQL/MariaDB decimal precision and scale and use DECIMAL for Currency.
- Preserve four Currency fractional digits in new Oracle column mappings.
- Use SQL Server VARBINARY(max) for binary capacities above 8000 bytes.
- Correct Firebird variable/fixed string and bounded binary mappings and
  recognize OCTETS columns as binary in catalog metadata.
- Bind Single and SByte values through the shared parameter implementation.
- Bind PostgreSQL UInt64 as Decimal and reject SQLite UInt64 values that
  exceed signed INTEGER storage instead of permitting lossy conversion.

Validation before commit: 823 combined Unit/SQLite tests and the additional
PostgreSQL driver-binding regression passed (824 total); coverage-summary
regressions and GitHub Actions lint passed. The local Unit/SQLite coverage
run increased line coverage from 43.35% to 44.94% and branch coverage from
37.78% to 39.25%. Ten server engines still require CI validation because
Docker is unavailable locally. Mapping changes affect generated DDL, not
existing tables automatically; coverage deltas remain informational.

Rebased onto current master before publication; all 843 locally executable
Unit and SQLite tests passed again on the rebased commit.
Copilot AI lite review requested due to automatic review settings September 22, 2026 22:19

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Normalize duplicate VSTest coverage attachments and reject missing or conflicting reports. Merge only canonical per-job reports and cover normalization with regression tests.

Correct PostgreSQL timestamp binding and character metadata, Oracle floating-point storage and character metadata, SQL Server precision and fixed-character metadata, Db2 byte parameters, and Informix large-text scalar reads. Render SQL NULL for null insert and update values to avoid untyped binary parameters.

Exercise binary NULL updates through both overloads and document native Informix, Sybase, and Firebird boundary semantics. Validation: 855 Unit and SQLite tests passed; coverage script tests and actionlint passed.
Copilot AI review requested due to automatic review settings September 22, 2026 22:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Bind Single values as native Oracle BinaryFloat instead of decimal FLOAT and verify the actual ODP.NET parameter type. Use sequential Informix scalar reads so IsDBNull cannot populate the faulty generic TEXT cache before GetString.

Assert Firebird's exact OverflowException when its driver rejects a scaled Int64 value outside the storage range. The boundary test still verifies the maximum accepted value and exact readback.

Validation: 856 Unit and SQLite tests passed. The preceding full matrix passed Unit, SQLite, SQL Server, PostgreSQL, MySQL, MariaDB, Db2, Sybase, and HANA; this follow-up addresses the remaining Oracle, Informix, and Firebird failures.
Copilot AI review requested due to automatic review settings September 22, 2026 22:47

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Dispose provider-owned connections in the shared test teardown even when cleanup fails. Disable pooling for per-test Oracle users, whose unique connection pools otherwise accumulate dedicated server processes and trigger ORA-00020.

Read Informix TEXT through bounded GetChars chunks while retaining the generic conversion for other types, including empty VARCHAR values. Keep exact large-text content assertions and all database tests enabled.

Validation: 856 Unit and SQLite tests pass; live Oracle and Informix cases are verified by the full CI matrix.
Copilot AI review requested due to automatic review settings September 22, 2026 22:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Select the ANSI long-character parameter mapping beyond LVARCHAR capacity to match the dialect's TEXT storage. Remove the scalar-reader workaround because both typed and streamed reads reproduced the same corrupted stored suffix.

Validation: 856 Unit and SQLite tests pass. Exact 70,005-character live round trips remain required in CI.
Copilot AI review requested due to automatic review settings September 22, 2026 22:57

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Record native Oracle float parameter binding, the Informix large-text transfer investigation, and deterministic connection disposal with pooling disabled for isolated Oracle users. Update local validation to 856 passing cases.
Copilot AI review requested due to automatic review settings September 22, 2026 22:59

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Emit bounded byte-suffix and parameter-mapping diagnostics only when the exact large-text round trip fails. Preserve the failing assertion while distinguishing native storage corruption from reader conversion.
Copilot AI review requested due to automatic review settings September 22, 2026 23:02

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Read string scalars through GetString without first calling IsDBNull, which eagerly caches the faulty generic TEXT conversion. Handle database NULL only after the typed getter reports an invalid cast. Non-string scalars retain the normal reader path.

Byte-level CI diagnostics confirmed the complete suffix is stored correctly. Remove the unsuccessful parameter-binding workaround and temporary diagnostics. Validation: 856 local Unit and SQLite tests passed.
Copilot AI review requested due to automatic review settings September 22, 2026 23:08

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Bypass the native Unicode conversion that replaces the final TEXT character with NUL. Read raw bytes sequentially, verify complete retrieval, and decode using the database GL_CTYPE locale rather than guessing the client encoding.

Cover Latin-1, UTF-8, Windows-1252, and invalid UTF-8 decoding. Add an accented character to the large-text suffix in all eleven database suites so encoding errors remain observable.

Validation: 862 Unit and SQLite tests passed. Byte-level CI diagnostics proved that stored TEXT bytes were intact; all full-content assertions remain enabled.
Copilot AI review requested due to automatic review settings September 22, 2026 23:14

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jogibear9988
jogibear9988 merged commit 482b4d1 into master Sep 23, 2026
13 checks passed
@jogibear9988
jogibear9988 deleted the codex/coverage-database-boundaries branch September 23, 2026 04:19
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.

2 participants