Skip to content

Commit 6d64050

Browse files
committed
Test fix for .NET Core failures
1 parent 4c0e511 commit 6d64050

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/ResourceManager/DataFactoryV2/Commands.DataFactoryV2.Test/ScenarioTests/IntegrationRuntimeTests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ function Test-SsisAzure-IntegrationRuntime
122122
}
123123

124124
if ($catalogAdminPassword -eq $null){
125+
<#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Fake password to resource that has been deleted.")]#>
125126
$catalogAdminPassword = 'fakepassord'
126127
}
127128

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/RoleDefinitionTests.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-RoleDefinitionCreateTests
2121
# Setup
2222
# Basic positive case - read from file
2323
$rdName = 'CustomRole Tests Role'
24-
New-AzureRmRoleDefinitionWithId -InputFile .\Resources\NewRoleDefinition.json -RoleDefinitionId ee78fa8a-3cdd-418e-a4d8-949b57a33dcd
24+
New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\NewRoleDefinition.json" -RoleDefinitionId ee78fa8a-3cdd-418e-a4d8-949b57a33dcd
2525

2626
$rd = Get-AzureRmRoleDefinition -Name $rdName
2727
Assert-AreEqual "Test role" $rd.Description
@@ -70,7 +70,7 @@ function Test-RdNegativeScenarios
7070
$badIdException = "Cannot find role definition with id '" + $rdId + "'."
7171

7272
# Throws on trying to update the a role that does not exist
73-
Assert-Throws { Set-AzureRmRoleDefinition -InputFile .\Resources\RoleDefinition.json } $badIdException
73+
Assert-Throws { Set-AzureRmRoleDefinition -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" } $badIdException
7474

7575
# Role Defintion not provided.
7676
$roleDefNotProvided = "Parameter set cannot be resolved using the specified named parameters."
@@ -84,7 +84,7 @@ function Test-RdNegativeScenarios
8484
# Role not provided.
8585
$roleDefNotProvided = "Cannot validate argument on parameter 'Role'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again."
8686
Assert-Throws { Set-AzureRmRoleDefinition -Role $rdNull } $roleDefNotProvided
87-
Assert-Throws { Set-AzureRmRoleDefinition -InputFile .\Resources\RoleDefinition.json -Role $rd } $roleDefNotProvided
87+
Assert-Throws { Set-AzureRmRoleDefinition -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" -Role $rd } $roleDefNotProvided
8888

8989
#TODO add check for valid input file and valid role
9090

@@ -103,7 +103,7 @@ function Test-RDPositiveScenarios
103103
# Setup
104104
# Create a role definition with Name rdNamme.
105105
$rdName = 'Another tests role'
106-
$rd = New-AzureRmRoleDefinitionWithId -InputFile .\Resources\RoleDefinition.json -RoleDefinitionId 0a0e83bc-50b9-4c4d-b2c2-3f41e1a8baf2
106+
$rd = New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" -RoleDefinitionId 0a0e83bc-50b9-4c4d-b2c2-3f41e1a8baf2
107107
$rd = Get-AzureRmRoleDefinition -Name $rdName
108108

109109
# Update the role definition with action that was created in the step above.
@@ -129,7 +129,7 @@ function Test-RDUpdate
129129

130130
# Create a role definition with Name rdNamme.
131131
$rdName = 'Another tests role'
132-
$rd = New-AzureRmRoleDefinitionWithId -InputFile .\Resources\RoleDefinition.json -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
132+
$rd = New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
133133
$rd = Get-AzureRmRoleDefinition -Name $rdName
134134

135135
# Update the role definition with action that was created in the step above.
@@ -158,7 +158,7 @@ function Test-RDCreateFromFile
158158
$badScopeException = "Exception calling `"ExecuteCmdlet`" with `"0`" argument(s): `"Scope '/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f/ResourceGroups' should have even number of parts.`""
159159
try
160160
{
161-
$rd = New-AzureRmRoleDefinitionWithId -InputFile .\Resources\InvalidRoleDefinition.json -RoleDefinitionId 4482e4d1-8757-4d67-b3c1-5c8ccee3fdcc
161+
$rd = New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\InvalidRoleDefinition.json" -RoleDefinitionId 4482e4d1-8757-4d67-b3c1-5c8ccee3fdcc
162162
Assert-AreEqual "This assertion shouldn't be hit'" "New-AzureRmRoleDefinition should've thrown an exception"
163163
}
164164
catch
@@ -280,7 +280,7 @@ function Test-RoleDefinitionDataActionsCreateTests
280280
# Setup
281281
# Basic positive case - read from file
282282
$rdName = 'CustomRole Tests Role New'
283-
New-AzureRmRoleDefinitionWithId -InputFile .\Resources\DataActionsRoleDefinition.json -RoleDefinitionId e3efe8c9-d9ae-4f0e-838d-57ce43068a13
283+
New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\DataActionsRoleDefinition.json" -RoleDefinitionId e3efe8c9-d9ae-4f0e-838d-57ce43068a13
284284

285285
$rd = Get-AzureRmRoleDefinition -Name $rdName
286286
Assert-AreEqual "Test role" $rd.Description
@@ -322,7 +322,7 @@ function Test-RDGetCustomRoles
322322
# Setup
323323
# Basic positive case - read from file
324324
$rdName = 'Another tests role'
325-
$rd = New-AzureRmRoleDefinitionWithId -InputFile .\Resources\RoleDefinition.json -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
325+
$rd = New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
326326
$rd = Get-AzureRmRoleDefinition -Name $rdName
327327

328328
$roles = Get-AzureRmRoleDefinition -Custom
@@ -437,7 +437,7 @@ function Test-RDDataActionsNegativeTestCases
437437
# Setup
438438
# Basic positive case - read from file
439439
$rdName = 'Another tests role'
440-
$rd = New-AzureRmRoleDefinitionWithId -InputFile .\Resources\RoleDefinition.json -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
440+
$rd = New-AzureRmRoleDefinitionWithId -InputFile "$TestOutputRoot\Resources\RoleDefinition.json" -RoleDefinitionId 3d95b97a-5745-4c39-950c-0b608dea635f
441441
$rd = Get-AzureRmRoleDefinition -Name $rdName
442442

443443
$createdRole = Get-AzureRmRoleDefinition -Name $rdName

0 commit comments

Comments
 (0)