Invoke-DevartDatabaseTest

Synopsis

Runs tSQLt tests for specified database.

Syntax

Invoke-DevartDatabaseTests -InputObject <object> [-Class <string>] [-DataGeneratorProject <string>] [-IncludeTestData <SwitchParameter>] [-InstalltSQLtFramework <SwitchParameter>]
[-OutReportFileName <string>] [-QueryBatchTimeout <int>] [-ReportFormat {JUnit | MsTest}] [-RewriteReport <SwitchParameter>] [-SynchronizationOptions <string>]
[-TemporaryDatabaseServer <object>] [-UnInstalltSQLtFramework <SwitchParameter>] [-UnitTests <string>] [<CommonParameters>]

Description

Returns false if the tests are filed; otherwise true.

Parameters

-InputObject <object>

Database to run the tSQLt tests on. It can be a scripts folder, a NuGet package, or a database connection.

Required? true

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-InstalltSQLtFramework <SwitchParameter>

Install tSQLt Framework before executing tests.

Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false

-UnInstalltSQLtFramework <SwitchParameter>

Uninstall tSQLt Framework after execution of tests.

Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false

-RewriteReport <SwitchParameter>

Use this parameter to rewrite a report file.

Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false

-Class <string>

Use this parameter to run specific class tests. If you don’t use this parameter, every test will be run.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-UnitTests <string>

Use this parameter to run a specific test or a specific test suite. If you don’t use this parameter, every test will be run.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-OutReportFileName <string>

File path to export the test results to.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-ReportFormat <JUnit>

Format of the test results file.

Possible values: JUnit, MsTest

Required? false

Position? named

Default value JUnit

Accept pipeline input? false

Accept wildcard characters? false

-IncludeTestData <SwitchParameter>

Use this and DataGeneratorProject parameters to add test data to the database.

Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false

-DataGeneratorProject <string>

Use this parameter to specify a Data Generator project file (.dgen) that defines the data to be added to the test database.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-SynchronizationOptions <string>

Specifies the Schema Compare options used during creation of the script for validation.

To include additional options, specify a slash-separated list of the options.

For example: /IgnoreCase:Yes /IgnorePrimaryKeys:No

See related links for more detailed information about options.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-TemporaryDatabaseServer <object>

Connection to the temporary database used for validation. This parameter can be used if a script folder, an object, or a NuGet package is specified as -InputObject. Otherwise, the parameter will be ignored.

Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false

-QueryBatchTimeout <int>

The parameter is applied for each of the following expressions if the InputObject parameter or the TemporaryDatabaseServer parameter is an object of the DevartDatabaseConnectionInfo type:

  • temporary database creation script;

  • data generation script;

  • testing script.

The default parameter value is 30 seconds.

Required? false

Position? named

Default value 30

Accept pipeline input? false

Accept wildcard characters? false

-FilterPath <string>

Specifies the Schema Compare filter options used when generating a database to test against.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

<CommonParameters>

This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.

Outputs:

System.Boolean (returns true on success and false otherwise)

Examples:

---------- EXAMPLE 1 ----------
$testResult = Invoke-DevartDatabaseTests -InputObject $connection -InstalltSQLtFramework -IncludeTestData -DataGeneratorProject "DababaseName(MsSqlServer).dgen"
-OutReportFileName:"C:\Test Result.xml" -ReportFormat JUnit -RewriteReport

See web documentation for a complete list of supported SynchronizationOptions.