File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
src/ResourceManager/Profile/Commands.Profile.Test Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ namespace Microsoft.Azure.Commands.Profile.Test
20
20
{
21
21
public class ProfileModuleTests
22
22
{
23
- [ Fact ]
23
+ [ Fact ( Skip = "Removed flaky test from CI." ) ]
24
24
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
25
25
public void WarningOnIncompatibleVersions ( )
26
26
{
Original file line number Diff line number Diff line change 12
12
# limitations under the License.
13
13
# ----------------------------------------------------------------------------------
14
14
15
+ function Verify-TestRepoDeleted
16
+ {
17
+ $createdRepo = Get-PSRepository - Name " ProfileModuleTest" - ErrorAction Ignore
18
+ if ($createdRepo )
19
+ {
20
+ Unregister-PSRepository - Name " ProfileModuleTest"
21
+ }
22
+ }
23
+
15
24
<#
16
25
. SYNOPSIS
17
26
Tests warning gets printed on incompatible modules with profile
18
27
#>
19
28
function Test-LoadProfileModule
20
29
{
30
+ $testPassed = $false
31
+ # Clean environment
32
+ Verify- TestRepoDeleted
33
+
21
34
# Push current profile module
22
35
Get-PackageProvider - Name NuGet - ForceBootstrap
23
36
$global :pushedProfileModule = $ (Get-Module AzureRM.Profile).Path
@@ -29,15 +42,17 @@ function Test-LoadProfileModule
29
42
$global :buffer = Import-Module $global :pushedProfileModule 2>&1 3>&1 | Out-String
30
43
Write-Warning $global :buffer
31
44
Assert-True { $global :buffer -Like " *AzureRM.ApiManagement 998.9.8 is not compatible with AzureRM.Profile*" }
45
+ $testPassed = $true
32
46
} catch [system.exception ] {
33
- Write-Error $_ - ErrorAction Continue
47
+ Write-Error $_
34
48
} finally {
35
49
Uninstall-Module AzureRM.ApiManagement - ErrorAction Ignore
36
50
Uninstall-Module AzureRM.Profile - ErrorAction Ignore
37
51
}
38
52
} catch [system.exception ] {
39
- Write-Error $_ - ErrorAction Continue
53
+ Write-Error $_
40
54
} finally {
41
- Unregister-PSRepository - Name " ProfileModuleTest "
55
+ Verify - TestRepoDeleted
42
56
}
57
+ Assert-True { $testPassed -eq $true } " testPassed = $testPassed "
43
58
}
You can’t perform that action at this time.
0 commit comments