UnitAutogen

0.14.1

PowerShell module for UnitAutogen - auto-generated tSQLt unit tests with real branch coverage for SQL Server. Installs the framework AND the in-database (SQLCLR) predicate parser, runs generation and coverage, and exports Cobertura XML, JUnit XML, and HTML reports for Azure DevOps, GitHub Actions, Jenkins, GitLab CI, and SonarQube. The single C# predicate parser runs
PowerShell module for UnitAutogen - auto-generated tSQLt unit tests with real branch coverage for SQL Server. Installs the framework AND the in-database (SQLCLR) predicate parser, runs generation and coverage, and exports Cobertura XML, JUnit XML, and HTML reports for Azure DevOps, GitHub Actions, Jenkins, GitLab CI, and SonarQube. The single C# predicate parser runs inside SQL Server (no PowerShell-side parser); installation registers it and requires sysadmin once plus 'clr enabled'=1.
Show more

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name UnitAutogen

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name UnitAutogen

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

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 Export-UnitAutogenTests

Dependencies

This module has no dependencies.

Release Notes

## v0.14.1 (beta) - 2026-06-13

OUTPUT-value assertions get smarter, plus result-set test polish. All changes are additive
and conservative (no false failures); regenerate existing test classes to adopt them.

- Scalar OUTPUT parameters are now VALUE-asserted. The "assigns its OUTPUT parameters" test and
 the per-branch tests assert each output value -- exact (AssertEqualsString) for a deterministic
 output, or a constant LIKE skeleton (the string literals in the procedure body, with the
 runtime-varying spans wildcarded) when the output mixes constants with GETDATE / NEWID / RAND.
- Determinism is CONFIRMED BY MEASUREMENT, not just a source scan. Each output is measured twice
 in independent rolled-back runs separated past a clock tick; the exact value is asserted only
 when the source scan is clean AND both runs agree, otherwise it falls back to the skeleton -- so
 non-determinism hidden in a called function/procedure, a SCOPE_IDENTITY / sequence read, or
 order-sensitive aggregation cannot bake a value that later false-fails.
- The "executes with valid inputs" test is now a uniform smoke check for both read and write
 procedures, and the "returns rows matching baseline" test names its table explicitly
 (@ActualTable = N'#ActualResult'), matching the tSQLt table-name convention.
- NOT_TESTABLE and instrumentation messages reworded to neutral, professional guidance.

Regression-clean on AdventureWorks2025, HighValueCustomer and WideWorldImporters (0 fail / 0 err).

## v0.14.0 (beta) - 2026-06-12

BUG-001 FIX - generated branch tests restored to Arrange-Act-Assert with real effect
assertions; plus the new Export-UnitAutogenTests command.

- Seeded predicate-branch tests previously asserted the gate predicate on the seed BEFORE
 running the procedure (Arrange-Assert-Act) and never checked what the branch did -- a
 wrong-value / wrong-WHERE write passed the whole class green. They now run
 Arrange -> Act -> Assert and assert the arm's OBSERVED effect: INSERT adds rows, DELETE
 removes rows, UPDATE changes content with the row count held. The test captures its own
 before/after, so GETDATE()-style non-determinism cannot false-fail; anything the
 generator cannot resolve falls back to the previous smoke test (no false failures).
- New scripts/Check_Invariants.sql - a CI guard that fails if any generated test asserts
 before it executes the procedure under test. Regenerate existing test classes to adopt
 the new assertions.
- New Export-UnitAutogenTests scripts in-database test classes into a portable, idempotent
 .sql with a pre-flight guard requiring tSQLt + TestGen on the target.

## v0.13.0 (beta) - 2026-06-11

CORRECTNESS FIXES (independent core-engine review) + NULL tests now OFF by default.

- @EmitNullChecks now DEFAULTS TO 0. The per-parameter "accepts NULL" smoke tests are no longer
 forced; genuine NULL handling in a procedure is covered as a normal branch/line. Pass
 @EmitNullChecks = 1 to restore the previous per-parameter NULL tests.
- Alias / user-defined scalar types (e.g. dbo.Flag, dbo.Name) now resolve to their base type when
 sampling values, so alias-typed parameters and columns get real seeds and arguments instead of
 NULL -- fixes weakened WHERE lookups and seed inserts on alias-heavy schemas.
- Equality seeding now skips (rather than emitting `col = NULL`) when a comparand is NULL, so a
 branch over an unknown-typed value no longer self-fails its own assertion.
- The in-database SQLCLR predicate parser is now detected correctly by GenerateAndRunCoverage (the
 guard tested for a T-SQL proc type and silently skipped the CLR parser), so single-proc runs
 parse predicates and emit data-shape branch tests when the parser is installed.
- NOT_TESTABLE skip annotations now escape apostrophes in the reason ("unmatched quote" fixed).
- The interrupted-run self-heal now also recovers a procedure left missing after a crash between
 the rename and the synonym create (previously only the synonym-present state was detected).

Regression-clean on AdventureWorks2025, HighValueCustomer and WideWorldImporters (0 fail / 0 err).

## Earlier releases

Full release history (v0.12.0 back to v0.9.0) is in CHANGES.md and on the GitHub
Releases page: https://github.com/unitautogen/unitautogen-public-repo/releases

FileList

Version History

Version Downloads Last updated
0.14.1 (current version) 5 6/13/2026
0.14.0 4 6/12/2026
0.13.0 4 6/11/2026
0.12.0 8 6/7/2026
0.11.1 5 6/7/2026
0.11.0 7 6/6/2026
0.10.0 10 6/5/2026
0.9.14 18 6/4/2026
0.9.12 6 6/4/2026
0.9.11 9 6/4/2026
0.9.10 10 6/4/2026
0.9.9 9 6/3/2026
0.9.2 3 6/1/2026
0.9.1 4 5/30/2026
0.9.0 6 5/29/2026
Show more