Skip to content

Commit 7e8ff15

Browse files
authored
Merge pull request Azure#8913 from markcowl/net472-tests
Fix Net472 test build
2 parents c3527c3 + b6175f6 commit 7e8ff15

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

build.proj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,10 @@
261261
<AuthExclusions>$(LibraryRoot)src/**/Authenticators.csproj;</AuthExclusions>
262262
<AutomationExclusions>$(LibraryRoot)src/**/Automation.Test.csproj;</AutomationExclusions>
263263
<StorageExclusions>$(LibraryRoot)src/**/Storage.Test.csproj;</StorageExclusions>
264+
<PowerShellCommand Condition=" '$(PowerShellCommand)' == '' ">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
265+
<!-- All PowerShell commands have this prefix -->
266+
<PowerShellCommandPrefix>&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command</PowerShellCommandPrefix>
264267
</PropertyGroup>
265-
266268
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
267269
<Exec Command="dotnet new sln -n Azure.PowerShell --force" />
268270
<ItemGroup>

src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void TestNewDeploymentFromTemplateFile()
4141

4242
[Fact]
4343
[Trait(Category.AcceptanceType, Category.CheckIn)]
44+
[Trait(Category.RunType, Category.CoreOnly)]
4445
public void TestNewDeploymentFromTemplateObject()
4546
{
4647
TestRunner.RunTestScript("Test-NewDeploymentFromTemplateObject");

src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ function Test-NewDeploymentFromTemplateObject
8080

8181
$path = (Get-Item ".\").FullName
8282
$file = Join-Path $path "sampleDeploymentTemplate.json"
83-
$templateObject = ConvertFrom-Json ([System.IO.File]::ReadAllText($file)) -AsHashtable
83+
$json = ConvertFrom-Json ([System.IO.File]::ReadAllText($file))
84+
$templateObject = @{}
85+
$json.PSObject.Properties | % { $templateObject[$_.Name] = $_.Value }
8486
$deployment = New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateObject $templateObject -TemplateParameterFile sampleDeploymentTemplateParams.json
8587

8688
# Assert

tools/TestNet472Modules.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $rmItems | %{`
3636
-Wait `
3737
-WorkingDirectory $testDir `
3838
-NoNewWindow `
39-
-ArgumentList $_.FullName, $testConfig, '-trait "AcceptanceType=CheckIn"', '-notrait "Runtype=DesktopOnly"', '-notrait "Runtype=CoreOnly"', "-xml $logPath" `
39+
-ArgumentList $_.FullName, $testConfig, '-trait "AcceptanceType=CheckIn"', '-notrait "RunType=DesktopOnly"', '-notrait "RunType=CoreOnly"', "-xml $logPath" `
4040
}
4141
finally {
4242
$copiedItems | %{Remove-Item -Force (Join-Path $testDir $_.Name)}

0 commit comments

Comments
 (0)