diff --git a/.azure-pipelines/test-coverage.yml b/.azure-pipelines/test-coverage.yml index efacfe9b5709..569654465d21 100644 --- a/.azure-pipelines/test-coverage.yml +++ b/.azure-pipelines/test-coverage.yml @@ -19,6 +19,7 @@ parameters: variables: EnableTestCoverage: true TestCoverageLocation: $(Pipeline.Workspace)/artifacts + Codeql.Enabled: false pr: none trigger: none diff --git a/src/Sql/Sql.Test/LiveTests/TestLiveScenarios.ps1 b/src/Sql/Sql.Test/LiveTests/TestLiveScenarios.ps1 index c153f29040d5..8caae684e2de 100644 --- a/src/Sql/Sql.Test/LiveTests/TestLiveScenarios.ps1 +++ b/src/Sql/Sql.Test/LiveTests/TestLiveScenarios.ps1 @@ -1,4 +1,4 @@ -Invoke-LiveTestScenario -Name "Create, get, update and remove a new SQL Server" -Description "Test on new SQL Server" -ScenarioScript ` +Invoke-LiveTestScenario -Name "Create, get, update and remove a new SQL Server" -Description "Test on new SQL Server" -PowerShellVersion "5.1", "Latest" -ScenarioScript ` { param ($rg) @@ -11,8 +11,7 @@ Invoke-LiveTestScenario -Name "Create, get, update and remove a new SQL Server" $actual = New-AzSqlServer -ResourceGroupName $rgName ` -ServerName $serverName ` -Location $location ` - -SqlAdministratorCredentials ` - $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $adminSqlLogin, $(ConvertTo-SecureString -String $password -AsPlainText -Force)) + -SqlAdministratorCredentials $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $adminSqlLogin, $(ConvertTo-SecureString -String $password -AsPlainText -Force)) Assert-AreEqual $serverName $actual.ServerName Assert-AreEqual $rgName $actual.ResourceGroupName # Get created Sql Server @@ -23,11 +22,11 @@ Invoke-LiveTestScenario -Name "Create, get, update and remove a new SQL Server" $secureString = ConvertTo-SecureString $updatedPassword -AsPlainText -Force $null = Set-AzSqlServer -ResourceGroupName $rgName -ServerName $serverName -PublicNetworkAccess Disabled $actual = Get-AzSqlServer -ResourceGroupName $rgName -ServerName $serverName - Assert-AreEqual "Disabled" $actual.PublicNetworkAccess + Assert-AreEqual "Disabled" $actual.PublicNetworkAccess # Remove a Sql server $null = Remove-AzSqlServer -ResourceGroup $rgName -ServerName $serverName $actual = Get-AzSqlServer -ResourceGroup $rgName - Assert-False { $actual.ServerName -contains $serverName} + Assert-False { $actual.ServerName -contains $serverName } } # After testing the cmdlets of Sql Server, create a Sql Server for sql database testing. @@ -44,10 +43,9 @@ $ServerName = New-LiveTestResourceName $SqlServer = New-AzSqlServer -ResourceGroupName $RgName ` -ServerName $ServerName ` -Location $ResourceGroupLocation ` - -SqlAdministratorCredentials ` - $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AdminSqlLogin, $(ConvertTo-SecureString -String $Password -AsPlainText -Force)) + -SqlAdministratorCredentials $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AdminSqlLogin, $(ConvertTo-SecureString -String $Password -AsPlainText -Force)) -Invoke-LiveTestScenario -Name "Create a Sql Database" -Description "Test New-AzSqlDatabase" -NoResourceGroup -ScenarioScript ` +Invoke-LiveTestScenario -Name "Create a Sql Database" -Description "Test New-AzSqlDatabase" -PowerShellVersion "5.1", "Latest" -NoResourceGroup -ScenarioScript ` { $dbName = New-LiveTestResourceName @@ -59,19 +57,19 @@ Invoke-LiveTestScenario -Name "Create a Sql Database" -Description "Test New-AzS Remove-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName } -Invoke-LiveTestScenario -Name "Get a Sql Database" -Description "Test Get-AzSqlDatabase" -NoResourceGroup -ScenarioScript ` +Invoke-LiveTestScenario -Name "Get a Sql Database" -Description "Test Get-AzSqlDatabase" -PowerShellVersion "5.1", "Latest" -NoResourceGroup -ScenarioScript ` { $dbName = New-LiveTestResourceName $null = New-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName - $actual = Get-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName + $actual = Get-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName Assert-AreEqual $serverName $actual.ServerName Assert-AreEqual $rgName $actual.ResourceGroupName Assert-AreEqual $dbName $actual.DatabaseName Remove-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName } -Invoke-LiveTestScenario -Name "Update a Sql Database" -Description "Test Set-AzSqlDatabase" -NoResourceGroup -ScenarioScript ` +Invoke-LiveTestScenario -Name "Update a Sql Database" -Description "Test Set-AzSqlDatabase" -PowerShellVersion "5.1", "Latest" -NoResourceGroup -ScenarioScript ` { $dbName = New-LiveTestResourceName @@ -80,11 +78,11 @@ Invoke-LiveTestScenario -Name "Update a Sql Database" -Description "Test Set-AzS $actual = Get-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName Assert-AreEqual $dbName $actual.DatabaseName Assert-AreEqual "S0" $actual.RequestedServiceObjectiveName - Assert-AreEqual "Standard" $actual.Edition + Assert-AreEqual "Standard" $actual.Edition Remove-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName } -Invoke-LiveTestScenario -Name "Remove a Sql Database" -Description "Test Remove-AzSqlDatabase" -NoResourceGroup -ScenarioScript ` +Invoke-LiveTestScenario -Name "Remove a Sql Database" -Description "Test Remove-AzSqlDatabase" -PowerShellVersion "5.1", "Latest" -NoResourceGroup -ScenarioScript ` { $dbName = New-LiveTestResourceName @@ -92,7 +90,7 @@ Invoke-LiveTestScenario -Name "Remove a Sql Database" -Description "Test Remove- Remove-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName -DatabaseName $dbName $actual = Get-AzSqlDatabase -ResourceGroupName $RgName -ServerName $ServerName - Assert-False { $actual.DatabaseName -contains $dbName} + Assert-False { $actual.DatabaseName -contains $dbName } } # At the end of db test, clear the resource group -Clear-LiveTestResources -Name $RgName \ No newline at end of file +Clear-LiveTestResources -Name $RgName diff --git a/src/Synapse/Synapse.Test/LiveTests/TestLiveScenarios.ps1 b/src/Synapse/Synapse.Test/LiveTests/TestLiveScenarios.ps1 index bd9865c0f0d8..362838e33b2a 100644 --- a/src/Synapse/Synapse.Test/LiveTests/TestLiveScenarios.ps1 +++ b/src/Synapse/Synapse.Test/LiveTests/TestLiveScenarios.ps1 @@ -5,14 +5,14 @@ function GenerateDefinitionFile { ) $definition = [PSCustomObject]@{ - name = "DataFlow" + name = "DataFlow" properties = [PSCustomObject]@{ - type = "MappingDataFlow" + type = "MappingDataFlow" typeProperties = [PSCustomObject]@{ - sources = @() - sinks = @() + sources = @() + sinks = @() transformations = @() - scriptLines = @("") + scriptLines = @("") } } } @@ -20,7 +20,7 @@ function GenerateDefinitionFile { ConvertTo-Json $definition -Compress -Depth 3 | Out-File -FilePath $File -Encoding utf8 -NoNewline -Force } -Invoke-LiveTestScenario -Name "Create synapse data flow" -Description "Test creating a synapse data flow" -ScenarioScript ` +Invoke-LiveTestScenario -Name "Create synapse data flow" -Description "Test creating a synapse data flow" -PowerShellVersion "5.1", "Latest" -ScenarioScript ` { param ($rg) @@ -50,7 +50,7 @@ Invoke-LiveTestScenario -Name "Create synapse data flow" -Description "Test crea Assert-AreEqual $flowName $actual.Name } -Invoke-LiveTestScenario -Name "Remove synapse data flow" -Description "Test removing a synapse data flow" -ScenarioScript ` +Invoke-LiveTestScenario -Name "Remove synapse data flow" -Description "Test removing a synapse data flow" -PowerShellVersion "5.1", "Latest" -ScenarioScript ` { param ($rg)