Skip to content

Commit

Permalink
Merge branch 'preview' into feature/repairswagger
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddie Clayton authored Nov 15, 2018
2 parents ec97de9 + 00329a9 commit fb99c4b
Show file tree
Hide file tree
Showing 340 changed files with 209,076 additions and 1,626 deletions.
2 changes: 1 addition & 1 deletion src/ResourceManager/Aks/Commands.Aks.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Hyak.Common" version="1.1.3" targetFramework="net452" />
<package id="Microsoft.Azure.Common" version="2.1.4" targetFramework="net452" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Management.ResourceManager" version="1.9.0-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Management.ResourceManager" version="1.9.1-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.7.0" targetFramework="net452" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net452" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net452" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Analysis" version="2.0.4" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Authorization" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ResourceManager" version="1.9.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ResourceManager" version="1.9.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.7.0" targetFramework="net45" />
Expand Down
2 changes: 1 addition & 1 deletion src/ResourceManager/Automation/Automation.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ Global
{59D1B5DC-9175-43EC-90C6-CBA601B3565F} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7EB964F8-1A60-4113-A715-3087E4B215DE}
SolutionGuid = {321D48F0-23DC-42CE-8FA9-EBD686B690EC}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net472'">
<PackageReference Include="Microsoft.Azure.Management.Automation" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.Automation" Version="3.4.0-preview" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="1.2.1" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.1" />
Expand All @@ -40,9 +41,15 @@
</ItemGroup>

<ItemGroup>
<None Update="SessionRecords\**\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ScenarioTests\*.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ScenarioTests\Resources\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\MSTest.TestAdapter.1.3.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\..\packages\MSTest.TestAdapter.1.3.0\build\net45\MSTest.TestAdapter.props')" />
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
<PropertyGroup>
Expand Down Expand Up @@ -51,17 +52,20 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MSTest.TestFramework.1.3.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MSTest.TestFramework.1.3.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Azure.Management.Automation">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Automation.3.4.0-preview\lib\net452\Microsoft.Azure.Management.Automation.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScenarioTests\AccountTests.cs" />
<Compile Include="ScenarioTests\AutomationScenarioTestsBase.cs" />
<Compile Include="ScenarioTests\AutomationTests.cs" />
<Compile Include="ScenarioTests\HybridWorkerGroupTests.cs" />
<Compile Include="ScenarioTests\RunbookJobTests.cs" />
<Compile Include="ScenarioTests\SourceControlTests.cs" />
<Compile Include="ScenarioTests\UpdateManagementTests.cs" />
<Compile Include="UnitTests\GetAzureAutomationDscNodeConfigurationDeploymentSchedulesTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationDscNodeConfigurationTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationDscNodeReportTest.cs" />
Expand Down Expand Up @@ -122,9 +126,30 @@
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
<None Include="ScenarioTests\AccountTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\AutomationTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\HybridWorkerGroupTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\Resources\RB-GraphTutorial.graphrunbook">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\Resources\RB-PowerShellScriptTutorial.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\RunbookJobTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\SourceControlTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\UpdateManagementTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\Resources\fastjob.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -146,6 +171,80 @@
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="SessionRecords\Microsoft.Azure.Commands.Automation.Test.AccountTests\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.SourceControlTests\CreateGitHubSourceControlAndSync.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.SourceControlTests\CreateVsoGitSourceControlAndSync.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.SourceControlTests\CreateVsoTfvcSourceControlAndSync.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.HybridWorkerGroupTests\E2EHybridWorkerGroup.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateLinuxWeeklySUC.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateWindowsMonthlySUC.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateLinuxOneTimeSUCNonAzureOnly.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateLinuxOneTimeSUCWithAllOption.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateLinuxOneTimeSUCWithDefaults.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateWindowsOneTimeSUCWithAllOption.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\CreateWindowsOneTimeSUCWithDefaults.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\DeleteSUC.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllMachineRuns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllMachineRunsWithFilters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllMachineRunsWithFiltersNoResults.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllRuns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllRunsWithFilters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllRunsWithFiltersNoResults.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllSUCs.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SessionRecords\Commands.Automation.Test.UpdateManagementTests\GetAllSUCsForVM.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="SessionRecords\Commands.Automation.Test.RunbookJobTests\TestCreateRunbookGraph.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Automation.Test.RunbookJobTests\TestImportAndDeleteRunbookGraphical.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Automation.Test.RunbookJobTests\TestImportRunbookPowerShell.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("4.0.0")]
[assembly: AssemblyFileVersion("4.0.0")]
[assembly: AssemblyVersion("6.0.0")]
[assembly: AssemblyFileVersion("6.0.0")]
[assembly: CLSCompliant(false)]
[assembly: CollectionBehavior(DisableTestParallelization = true)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagemenet.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.Automation.Test
{
public class AccountTests : AutomationScenarioTestsBase
{
public XunitTracingInterceptor _logger;

public AccountTests(Xunit.Abstractions.ITestOutputHelper output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Service, Category.Automation)]
public void TestGetAutomationAccts()
{
RunPowerShellTest(_logger, "Test-GetAutomationAccounts");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Service, Category.Automation)]
public void TestAutomationAcctTags()
{
RunPowerShellTest(_logger, "Test-AutomationAccountTags");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

$newAccountName='account-powershell-test'
$existingResourceGroup='PowerShellTest'
$location = "West Central US"

########################################################################### Automation Scenario Tests ###########################################################################

######### $accountName and $subscriptionName should be provided in variables.yml in order to run the following Test Cases #######################

<#
.SYNOPSIS
Check if test account exists and remove it
#>
function CleanupExistingTestAccount
{
$check = Get-AzureRmAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -ErrorAction SilentlyContinue
if ($null -ne $check)
{
Remove-AzureRmAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -Force
}
}

function CreateResourceGroup
{
$check = Get-AzureRmResourceGroup -Name $existingResourceGroup -Location $location -ErrorAction SilentlyContinue
if ($null -eq $check)
{
New-AzureRmResourceGroup -Name $existingResourceGroup -Location $location -Force
}
}
<#
.SYNOPSIS
Create Test Automation Account
#>
function CreateTestAccount
{
return New-AzureRmAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -Location $location
}

<#
.SYNOPSIS
Tests Runbook with Parameters
#>
function Test-GetAutomationAccounts
{
# setup
CreateResourceGroup
CleanupExistingTestAccount

# get all accounts
$automationAccounts = Get-AzureRmAutomationAccount
Assert-NotNull $automationAccounts "Get All automation accounts return null."

$existingAccountCount = $automationAccounts.Count

$newAutomationAccount = CreateTestAccount
Assert-NotNull $newAutomationAccount "Create Account Failed."

#Test
$automationAccounts = Get-AzureRmAutomationAccount

$newAccountCount = $automationAccounts.Count
Assert-AreEqual ($existingAccountCount+1) $newAccountCount "There should have only 1 more account"

CleanupExistingTestAccount
}

<#
.SYNOPSIS
Tests of Start and Stop RunBook
#>
function Test-AutomationAccountTags
{
# setup
CreateResourceGroup
CleanupExistingTestAccount
$newAutomationAccount = CreateTestAccount
Assert-AreEqual $newAutomationAccount.Tags.Count 0 "Unexpected Tag Counts"

# re-put using new
$newAutomationAccount = New-AzureRmAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -Location $location -Tags @{"abc"="def"; "gg"="hh"}
Assert-AreEqual $newAutomationAccount.Tags.Count 2 "Unexpected Tag Counts from new"
Assert-AreEqual $newAutomationAccount.Tags["gg"] "hh" "Unexpected Tag Content from new"

# use Set
$newAutomationAccount = Set-AzureRmAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -Tags @{"lm"="jk"}
Assert-AreEqual $newAutomationAccount.Tags.Count 1 "Unexpected Tag Counts from set"
Assert-AreEqual $newAutomationAccount.Tags["lm"] "jk" "Unexpected Tag Content from set"

# test tag from accounts
$newAutomationAccount = Get-AzureRmAutomationAccount | Where-Object {$_.AutomationAccountName -eq $newAccountName }
Assert-AreEqual $newAutomationAccount.Tags.Count 1 "Unexpected Tag Counts from get all"
Assert-AreEqual $newAutomationAccount.Tags["lm"] "jk" "Unexpected Tag Content from get all"

CleanupExistingTestAccount
}
Loading

0 comments on commit fb99c4b

Please sign in to comment.