Skip to content

Command Line Tool - TestRun

Run tSQLt tests against a target database context.

Enlight testRun
--connectionString=<sqlConnectionString>
[--filter=<wildcardPattern>]
[--class=<testClassName>]
[--singleTest=<testName>]
[--reportFormat=<format>]
[--reportOutput=<outputPath>]
[--verbosity=<level>]
[--nologo]
[--timeout=<seconds>]
Parameter Description
class Run a single tSQLt test class (schema name), e.g. [CustomerTests].
singleTest Run a single test, e.g. [CustomerTests].[test something].
filter Include tests matching wildcard pattern, e.g. *Customer*.
reportFormat (Default: Json) Valid values: None, Json, JUnit, VSTest.
reportOutput Output file or directory for json/junit reports.
verbosity (Default: Normal) Output verbosity level. Valid values: Quiet, Normal, Detail, Verbose.
nologo (Default: true) Do not show header and copyright info.
connectionString Required. SQL connection string for the target context database.
timeout (Default: 300) SQL command timeout in seconds.

Run tests in tSqlt_Examples database with test filter:

Enlight testRun
--connectionString="Server=.;Database=tSqlt_Examples;Integrated Security=True;"
--filter=*Customer* --timeout=600 --verbosity=Normal

Run tests in tSqlt_Examples database with test class filter:

Enlight testRun
--class=[CustomerTests]
--connectionString="Server=.;Database=tSqlt_Examples;Integrated Security=True;"
--filter=*Customer* --timeout=600 --verbosity=Normal

Run tests in tSqlt_Examples database with single test filter:

Enlight testRun
--connectionString="Server=.;Database=tSqlt_Examples;Integrated Security=True;"
--singleTest="[CustomerTests].[test something]" --timeout=600
--verbosity=Normal