Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5cfd159
Kusto: Add kusto
radennis Sep 2, 2018
1ff7e18
Remove database type
radennis Sep 2, 2018
5f1d3c8
Addressed comments
elirazcc Sep 6, 2018
db6cf16
Fix powerBI file
elirazcc Sep 6, 2018
de216ef
Merge branch 'preview' into AddKusto-2
Sep 6, 2018
89def80
Kusto: Add kusto
radennis Sep 2, 2018
2856315
Remove database type
radennis Sep 2, 2018
27522cf
Addressed comments
elirazcc Sep 6, 2018
32f385a
Fix powerBI file
elirazcc Sep 6, 2018
2481a8a
Merge branch 'AddKusto-2' of https://github.com/Azure/azure-powershel…
elirazcc Sep 12, 2018
3636fd4
Removed all common projects and import target
elirazcc Sep 12, 2018
0762df5
Remove app.config
elirazcc Sep 12, 2018
2ac2324
Remove package from local feed
elirazcc Sep 13, 2018
8bf755b
Fixed comments
elirazcc Sep 13, 2018
b057779
Update GetAzureRmKustoCluster.cs
Sep 17, 2018
5eb067b
Merge branch 'preview' into AddKusto-2
Sep 18, 2018
e1391b7
Update AzureRM.Kusto.psd1
Sep 18, 2018
9dc08a1
Powershell nuget - Start implementing tests
elirazcc Oct 23, 2018
c8eb778
Merge branch 'AddKusto-2' of https://github.com/Azure/azure-powershel…
elirazcc Oct 23, 2018
5910d24
fix test project and psd1
Nov 20, 2018
17e7da8
Added tests and added more commands
oflipman Dec 5, 2018
8a75830
Removed ClearAzureRmDefault
oflipman Dec 5, 2018
3dcab92
Merge branch 'master' into AddKusto-2
Dec 5, 2018
4d8f5c1
Fixed comments
oflipman Dec 12, 2018
915d4b6
latzest
oflipman Dec 12, 2018
8eff266
Merge from master
oflipman Dec 12, 2018
e987762
fixed breaking changes with master
oflipman Dec 12, 2018
db8a079
Fix Kusto build and test issues.
MiYanni Dec 12, 2018
26e2d33
Merge branch 'AddKusto-2' of https://github.com/Azure/azure-powershel…
MiYanni Dec 12, 2018
42dc29f
Fixed Kusto test running.
MiYanni Dec 13, 2018
62b70d9
Merge branch 'master' into AddKusto-2
markcowl Dec 14, 2018
586b005
Fixed comments
oflipman Dec 16, 2018
5c78e15
Merge branch 'AddKusto-2' of https://github.com/Azure/azure-powershel…
oflipman Dec 16, 2018
d1dafa9
Merge branch 'master' into AddKusto-2
markcowl Dec 17, 2018
3646561
Update MissingAssemblies.csv
Dec 18, 2018
69345c0
fixed comments
oflipman Dec 18, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="$(ProjectDir)..\..\..\..\tools\Common.Netcore.Dependencies.Test.targets" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.0</TargetFrameworks>
<AssemblyName>Microsoft.Azure.PowerShell.Cmdlets.Kusto.Test</AssemblyName>
<RootNamespace>Microsoft.Azure.Commands.Kusto.Test</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DelaySign>false</DelaySign>
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
<DefineConstants>TRACE;RELEASE;NETSTANDARD;SIGN</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Kusto" Version="0.9.0-preview" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Commands.Kusto\Commands.Kusto.Netcore.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="SessionRecords\**\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ScenarioTests\*.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Xunit;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Commands.Kusto.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Commands.Kusto.Test")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("05e8f0bd-c388-4fd7-b3e9-b06049fe8131")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: CollectionBehavior(DisableTestParallelization = true)]
215 changes: 215 additions & 0 deletions src/ResourceManager/Kusto/Commands.Kusto.Test/ScenarioTests/Common.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Gets resource location for testing.
#>
function Get-Cluster-Location
{
return Get-Location "Microsoft.Kusto" "operations" "Central US"
}

function Get-RG-Location
{
Get-Location "Microsoft.Resources" "resourceGroups" "Central US"
}

<#
.SYNOPSIS
Gets a name of the resource group testing.
#>
function Get-RG-Name
{
return getAssetname
#return "KustoPSClientTest"
}

<#
.SYNOPSIS
Gets a name of the cluster testing.
#>
function Get-Cluster-Name
{
return getAssetName
#return "kustopsclienttest"
}

<#
.SYNOPSIS
Gets a sku name
#>
function Get-Sku
{
return "D13_v2"
}

<#
.SYNOPSIS
Gets a sku diferent sku name.
#>
function Get-Updated-Sku
{
return "D14_v2"
}

<#
.SYNOPSIS
Gets a name of a not existing resource group for testing.
#>
function Get-Cluster-Resource-Type
{
return "Microsoft.Kusto/Clusters"
}

<#
.SYNOPSIS
Gets a cluster resource id
#>
function Get-Cluster-Resource-Id
{
Param([string]$Subscription,
[string]$ResourceGroupName,
[string]$ClusterName)
return "/subscriptions/$Subscription/resourceGroups/$ResourceGroupName/providers/Microsoft.Kusto/clusters/$ClusterName"
}

<#
.SYNOPSIS
Gets a database resource id
#>
function Get-Database-Resource-Id
{
Param([string]$Subscription,
[string]$ResourceGroupName,
[string]$ClusterName,
[string]$DatabaseName)
$clusterResourceId = Get-Cluster-Resource-Id -Subscription $Subscription -ResourceGroupName $ResourceGroupName -ClusterName $ClusterName
return "$clusterResourceId/databases/$DatabaseName"
}


<#
.SYNOPSIS
Gets a database name
#>
function Get-Database-Name
{
return getAssetName
}

<#
.SYNOPSIS
Gets a database type
#>
function Get-Database-Type
{
return "Microsoft.Kusto/Clusters/Databases"
}

<#
.SYNOPSIS
Gets a database soft delet perios in days parameter
#>
function Get-Soft-Delete-Period-In-Days
{
return 4
}

<#
.SYNOPSIS
Gets a database hot cache period in days
#>
function Get-Hot-Cache-Period-In-Days
{
return 2
}

<#
.SYNOPSIS
Gets a different database soft delet perios in days parameter ( for testing update)
#>
function Get-Updated-Soft-Delete-Period-In-Days
{
return 6
}

<#
.SYNOPSIS
Gets a different database hot cache period in days (for testring update)
#>
function Get-Updated-Hot-Cache-Period-In-Days
{
return 3
}

<#
.SYNOPSIS
Gets a the database does not exist message
#>
function Get-Database-Not-Exist-Message
{
Param([string]$DatabaseName)
return "$DatabaseName' is not found"
}

<#
.SYNOPSIS
Gets a the cluster does not exist message
#>
function Get-Cluster-Not-Exist-Message
{
Param([string]$ResourceGroupName,
[string]$ClusterName)
return "'Microsoft.Kusto/clusters/$ClusterName' under resource group '$ResourceGroupName' was not found"
}


<#
.SYNOPSIS
Gets a the cluster does not exist message
#>
function Get-Cluster-Name-Exists-Message
{
Param([string]$ClusterName)
return "Name '$ClusterName' with type Engine is already taken. Please specify a different name"
}


<#
.SYNOPSIS
Executes a cmdlet and enables ignoring of errors if desired
NOTE: this only catches errors that are thrown. If the command calls to Write-Error
the user must specify the errorAction to be silent or store the record in an error variable.
#>
function Invoke-HandledCmdlet
{
param
(
[ScriptBlock] $Command,
[switch] $IgnoreFailures
)

try
{
&$Command
}
catch
{
if(!$IgnoreFailures)
{
throw;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// ----------------------------------------------------------------------------------
//
// 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.WindowsAzure.Commands.ScenarioTest;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Xunit;
using Microsoft.Azure.Commands.ScenarioTest;

namespace Microsoft.Azure.Commands.Kusto.Test.ScenarioTests
{
public class KustoClusterTests : KustoTestsBase
{
private readonly XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestKustoClusterLifecycle()
{
NewInstance.RunPsTest(_logger, "Test-KustoClusterLifecycle");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestKustoClusterName()
{
NewInstance.RunPsTest(_logger, "Test-KustoClusterName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestKustoClusterUpdate()
{
NewInstance.RunPsTest(_logger, "Test-KustoClusterUpdate");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestKustoClusterSuspendResume()
{
NewInstance.RunPsTest(_logger, "Test-KustoClusterSuspendResume");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestKustoClusterRemove()
{
NewInstance.RunPsTest(_logger, "Test-KustoClusterRemove");
}

}
}
Loading