UnitAutogen
0.9.14
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
(C) 2026 Munaf Ibrahim Khatri. Licensed under AGPL-3.0.
Package Details
Author(s)
- Munaf Ibrahim Khatri
Tags
SQL SQLServer tSQLt Coverage CI-CD Cobertura JUnit AzureDevOps Testing UnitTest CodeCoverage BranchCoverage DatabaseTesting AutomatedTesting
Functions
Install-UnitAutogenDatabase Invoke-UnitAutogen Export-CoverageCoberturaXml Export-TestResultsJunitXml Export-CoverageHtmlReport
Dependencies
This module has no dependencies.
Release Notes
## v0.9.14 (beta) — 2026-06-04
Reporting-quality refinements (no coverage-number change - all are genuinely
not-auto-coverable cases, now reported honestly):
- A procedure whose error-handling CATCH runs its own ROLLBACK TRANSACTION now skips
its error path with an exact reason (the ROLLBACK would unwind tSQLt's per-test
transaction - Msg 266) instead of a generic "no analysable branches" message.
- Inline table-valued functions (RETURNS TABLE AS RETURN ...) are now reported as a
clean NOT_TESTABLE ("a single set query - no statements or branches to instrument;
coverage does not apply") rather than a generic instrumenter "deferred".
- Fix: a SkipTest reason containing an apostrophe (e.g. "tSQLt's") no longer errors
the test with "Annotation has unmatched quote" - the reason text is now
quote-escaped at both emit sites.
## v0.9.12 (beta) — 2026-06-04
Two fixes from broad-database validation on WideWorldImporters (both v0.9.11 fixes
held there - 0 failures, no doomed transactions):
- Result-row baseline now quotes JSON keys, so result columns with spaces or special
characters in their names (e.g. "Quantity On Hand") work. Previously an unquoted
OPENJSON path raised "JSON path is not properly formatted" (Msg 13607) and the test
errored. Common in real-world schemas; AdventureWorks' tight names never hit it.
- Functions/procedures declared WITH EXECUTE AS OWNER (or CALLER/SELF/'user') now
build their coverage shadow correctly. The header splitter was matching the AS
inside "EXECUTE AS OWNER" and failing with "Incorrect syntax near 'OWNER'". A
self-contained EXECUTE AS OWNER function now reaches 100% line / 100% branch.
## v0.9.11 (beta) — 2026-06-04
Fix: the v0.9.10 schema-bound cleanup could doom the test transaction, turning
whole groups of procedures into all-errors (0% coverage) on real databases.
- Cause: the schema-bound dependent walk in SafeFakeTable used a recursive query
with no cycle guard. A table with a persisted computed column built on a
WITH SCHEMABINDING function references ITSELF as schema-bound (e.g. AdventureWorks
Sales.Customer.AccountNumber), so the walk hit the recursion limit and errored.
tSQLt runs tests with XACT_ABORT ON, under which that error dooms the transaction,
so every later table-fake then failed with "the current transaction cannot be
committed".
- Fix: the cleanup now runs under SET XACT_ABORT OFF (auto-restored on exit) so it
can never doom the test, and the walk ignores the self-edge and guards against
cycles. Validated on a clean AdventureWorks2025: 0 errors across the testable
procedures and functions.
Also: result-set shape characterization no longer compares IsNullable. SQL Server's
nullability inference for literal/computed result columns is unstable (flips across
recompiles/builds), which produced false-positive "shape drift" failures. Column
count, order, names, types and sizes are still asserted in full.
## Earlier releases
Full release history (v0.9.10 back to v0.9.0) is in CHANGES.md and on the GitHub
Releases page: https://github.com/unitautogen/unitautogen-public-repo/releases
FileList
- UnitAutogen.nuspec
- UnitAutogen.psd1
- UnitAutogen.psm1
- sql\Install-UnitAutogenClr.SSMS.sql
- sql\Install_UnitAutogen.sql