I am currently using Microsoft SQL Server Enterprise (64-bit) version 13.0.5103.6 as my build server. My tsqlt test is working fine in this server without code coverage. But when I enable code coverage from Azure DevOps, it creates the below error. I looked into the dependencies for the tSqlt to work and it seems my SQL version does support this. Error is pasted below:
2021-05-27T12:52:55.2944068Z Error starting trace: System.InvalidOperationException: Error creating the extended events trace, error: This operation is not supported in this version of SQL Server. ---> System.Data.SqlClient.SqlException: This operation is not supported in this version of SQL Server.
2021-05-27T12:52:55.2945951Z at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) 2021-05-27T12:52:55.2946503Z at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) 2021-05-27T12:52:55.2947380Z at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) 2021-05-27T12:52:55.2947968Z at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) 2021-05-27T12:52:55.2948540Z at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
2021-05-27T12:52:55.2949022Z at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
2021-05-27T12:52:55.2949515Z at SQLCover.Gateway.DatabaseGateway.Execute(String command, Int32 timeOut) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Gateway\DatabaseGateway.cs:line 116
2021-05-27T12:52:55.2950242Z at SQLCover.Trace.TraceController.RunScript(String query, String error, Int32 timeout) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\TraceController.cs:line 33
2021-05-27T12:52:55.2951805Z --- End of inner exception stack trace ---
2021-05-27T12:52:55.2952318Z at SQLCover.Trace.TraceController.RunScript(String query, String error, Int32 timeout) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\TraceController.cs:line 37
2021-05-27T12:52:55.2953017Z at SQLCover.Trace.AzureTraceController.Create() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\AzureTraceController.cs:line 57
2021-05-27T12:52:55.2953644Z at SQLCover.Trace.AzureTraceController.Start() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\AzureTraceController.cs:line 62
2021-05-27T12:52:55.2954205Z at SQLCover.CodeCoverage.Start() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\CodeCoverage.cs:line 71
2021-05-27T12:52:55.2971298Z ##[error]Microsoft.PowerShell.Commands.WriteErrorException: Error while starting the Unit Test with Code Coverage session.
2021-05-27T12:52:55.3279309Z ##[error]PowerShell script completed with 1 errors.
2021-05-27T12:52:55.3286502Z ##[section]Finishing: Run tSQLt Unit Tests
I am currently using Microsoft SQL Server Enterprise (64-bit) version 13.0.5103.6 as my build server. My tsqlt test is working fine in this server without code coverage. But when I enable code coverage from Azure DevOps, it creates the below error. I looked into the dependencies for the tSqlt to work and it seems my SQL version does support this. Error is pasted below:
2021-05-27T12:52:55.2944068Z Error starting trace: System.InvalidOperationException: Error creating the extended events trace, error: This operation is not supported in this version of SQL Server. ---> System.Data.SqlClient.SqlException: This operation is not supported in this version of SQL Server.
2021-05-27T12:52:55.2945951Z at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction) 2021-05-27T12:52:55.2946503Z at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) 2021-05-27T12:52:55.2947380Z at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) 2021-05-27T12:52:55.2947968Z at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) 2021-05-27T12:52:55.2948540Z at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)2021-05-27T12:52:55.2949022Z at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
2021-05-27T12:52:55.2949515Z at SQLCover.Gateway.DatabaseGateway.Execute(String command, Int32 timeOut) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Gateway\DatabaseGateway.cs:line 116
2021-05-27T12:52:55.2950242Z at SQLCover.Trace.TraceController.RunScript(String query, String error, Int32 timeout) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\TraceController.cs:line 33
2021-05-27T12:52:55.2951805Z --- End of inner exception stack trace ---
2021-05-27T12:52:55.2952318Z at SQLCover.Trace.TraceController.RunScript(String query, String error, Int32 timeout) in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\TraceController.cs:line 37
2021-05-27T12:52:55.2953017Z at SQLCover.Trace.AzureTraceController.Create() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\AzureTraceController.cs:line 57
2021-05-27T12:52:55.2953644Z at SQLCover.Trace.AzureTraceController.Start() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\Trace\AzureTraceController.cs:line 62
2021-05-27T12:52:55.2954205Z at SQLCover.CodeCoverage.Start() in C:\repos\OSS\SQLCover-riserrad\src\SQLCover\SQLCover\CodeCoverage.cs:line 71
2021-05-27T12:52:55.2971298Z ##[error]Microsoft.PowerShell.Commands.WriteErrorException: Error while starting the Unit Test with Code Coverage session.
2021-05-27T12:52:55.3279309Z ##[error]PowerShell script completed with 1 errors.
2021-05-27T12:52:55.3286502Z ##[section]Finishing: Run tSQLt Unit Tests