Skip to content

Commit

Permalink
Fixed 2 more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NowinskiK committed Oct 29, 2024
1 parent c653462 commit c34a9de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions test/!RunAllTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Param(
[Switch]$InstallModules
)

Write-Host " ========= ENVIRONMENT =========="
Write-Host "Host Name: $($Host.name)"
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"

$rootPath = Switch ($Host.name) {
'Visual Studio Code Host' { split-path $psEditor.GetEditorContext().CurrentFile.Path }
Expand All @@ -25,8 +27,8 @@ $folder = Split-Path $rootPath -Parent

Write-Host "Setting new location: $folder"
Push-Location "$folder"
Get-Location | Out-Host

Get-Location
Write-Host " ========= ENVIRONMENT =========="

# Add the module location to the value of the PSModulePath environment variable
#$p = [Environment]::GetEnvironmentVariable("PSModulePath")
Expand Down
2 changes: 1 addition & 1 deletion test/Incremental-Deployment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ InModuleScope azure.datafactory.tools {
}
It 'Should fails when Container doesn''t exist' {
{ Set-StateToStorage -ds $dstate -DataFactoryName $DataFactoryName -LocationUri "$($script:StorageUri)/nocontainer997755/folder" }
| Should -Throw -ExceptionType ([System.Management.Automation.RuntimeException])
| Should -Throw -ExceptionType ([Microsoft.Azure.Storage.StorageException])
}
}

Expand Down
9 changes: 5 additions & 4 deletions test/Publish-AdfV2FromJson-2.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ InModuleScope azure.datafactory.tools {
-DataFactoryName "$DataFactoryName" `
-Location "$Location" -Option $opt
}
It 'New GP "adftools_deployment_state" should exist' {
$f = Get-AzDataFactoryV2 -ResourceGroupName $t.ResourceGroupName -DataFactoryName $t.DataFactoryName
$f.GlobalParameters.Keys.Contains("adftools_deployment_state") | Should -Be $true
}
# This is no longer valid as new version keep state in Storage, not in ADF
# It 'New GP "adftools_deployment_state" should exist' {
# $f = Get-AzDataFactoryV2 -ResourceGroupName $t.ResourceGroupName -DataFactoryName $t.DataFactoryName
# $f.GlobalParameters.Keys.Contains("adftools_deployment_state") | Should -Be $true
# }

It 'Should run successfully even when no Global Params are in target (exists) ADF' {
Publish-AdfV2FromJson -RootFolder "$RootFolder" `
Expand Down

0 comments on commit c34a9de

Please sign in to comment.