Skip to content

Commit 0397ccf

Browse files
committed
Got SQL tests running in netcore. Added filter (RunType = DesktopOnly) for tests that should only be ran on desktop (non-netcore). Also, made tests skipped explicitly so that it is easier to test/debug later. Fixed up some references for Microsoft.Azure.Test to use Microsoft.Rest.ClientRuntime.Azure.TestFramework instead.
1 parent e4015fb commit 0397ccf

File tree

10 files changed

+270
-8
lines changed

10 files changed

+270
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before_install:
2121

2222
script:
2323
- dotnet msbuild build.proj /t:BuildNetcore /p:Configuration=$CONFIG
24-
- dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter="AcceptanceType=CheckIn" --configuration $CONFIG
24+
- dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter="AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $CONFIG
2525

2626
after_success:
2727
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

src/Azure.PowerShell.Netcore.Test.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Network.Test.Netco
2323
EndProject
2424
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Storage.Netcore", "Common\Commands.Common.Storage\Common.Storage.Netcore.csproj", "{3BDE1B1A-AA9A-45B1-A897-CDB31B6800C8}"
2525
EndProject
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Sql.Test.Netcore", "ResourceManager\Sql\Commands.Sql.Test\Commands.Sql.Test.Netcore.csproj", "{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -153,6 +155,18 @@ Global
153155
{3BDE1B1A-AA9A-45B1-A897-CDB31B6800C8}.Release|x64.Build.0 = Release|Any CPU
154156
{3BDE1B1A-AA9A-45B1-A897-CDB31B6800C8}.Release|x86.ActiveCfg = Release|Any CPU
155157
{3BDE1B1A-AA9A-45B1-A897-CDB31B6800C8}.Release|x86.Build.0 = Release|Any CPU
158+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
159+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|Any CPU.Build.0 = Debug|Any CPU
160+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|x64.ActiveCfg = Debug|Any CPU
161+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|x64.Build.0 = Debug|Any CPU
162+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|x86.ActiveCfg = Debug|Any CPU
163+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Debug|x86.Build.0 = Debug|Any CPU
164+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|Any CPU.ActiveCfg = Release|Any CPU
165+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|Any CPU.Build.0 = Release|Any CPU
166+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|x64.ActiveCfg = Release|Any CPU
167+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|x64.Build.0 = Release|Any CPU
168+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|x86.ActiveCfg = Release|Any CPU
169+
{F6D1E454-E51D-4F1F-916A-A4A3DED5850A}.Release|x86.Build.0 = Release|Any CPU
156170
EndGlobalSection
157171
GlobalSection(SolutionProperties) = preSolution
158172
HideSolutionNode = FALSE

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ The connection string containing username and password information
475475
function getTestCredentialFromString
476476
{
477477
param([string] $connectionString)
478-
$parsedString = [Microsoft.Azure.Test.TestUtilities]::ParseConnectionString($connectionString)
478+
$parsedString = [Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::ParseConnectionString($connectionString)
479479
if (-not ($parsedString.ContainsKey([Microsoft.Azure.Test.TestEnvironment]::UserIdKey) -or ((-not ($parsedString.ContainsKey([Microsoft.Azure.Test.TestEnvironment]::AADPasswordKey))))))
480480
{
481481
throw "The connection string '$connectionString' must have a valid value, including username and password " +`
@@ -494,7 +494,7 @@ The connection string containing subscription information
494494
function getSubscriptionFromString
495495
{
496496
param([string] $connectionString)
497-
$parsedString = [Microsoft.Azure.Test.TestUtilities]::ParseConnectionString($connectionString)
497+
$parsedString = [Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::ParseConnectionString($connectionString)
498498
if (-not ($parsedString.ContainsKey([Microsoft.Azure.Test.TestEnvironment]::SubscriptionIdKey)))
499499
{
500500
throw "The connection string '$connectionString' must have a valid value, including subscription " +`

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public class Category
7474
//Uncomment when we need to tag on only run under mock
7575
//public const string MockedOnly = "MockedOnly";
7676

77+
public const string DesktopOnly = "DesktopOnly";
78+
7779
// Environment
7880
public const string Environment = "Environment";
7981

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.Netcore.csproj

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@
2525
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.2.0-preview" />
2626
<PackageReference Include="Microsoft.Azure.Management.Network" Version="17.0.0-preview" />
2727
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.13.0-preview" />
28-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="2.4.0-preview" />
29-
<PackageReference Include="Microsoft.WindowsAzure.Configuration" Version="3.2.0" />
30-
<PackageReference Include="Microsoft.WindowsAzure.Management.Storage" Version="5.1.1" />
3128
</ItemGroup>
3229

3330
<ItemGroup>
3431
<ProjectReference Include="..\..\Common\Commands.Common.Authentication.ResourceManager\Common.ResourceManager.Authentication.Netcore.csproj" />
3532
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Common.Authentication.Abstractions.Netcore.csproj" />
33+
<ProjectReference Include="..\..\..\Common\Commands.Common.Storage\Common.Storage.Netcore.csproj" />
3634
<ProjectReference Include="..\..\..\Common\Commands.Common\Common.Netcore.csproj" />
3735
<ProjectReference Include="..\..\Common\Commands.ResourceManager.Common\Common.ResourceManager.Netcore.csproj" />
3836
<ProjectReference Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\Common.ResourceManager.ScenarioTests.Netcore.csproj" />
3937
</ItemGroup>
4038

39+
<ItemGroup>
40+
<Reference Include="Microsoft.Azure.Commands.Sql">
41+
<HintPath>..\..\..\Package\$(Configuration)\ResourceManager\AzureResourceManager\AzureRM.Sql.Netcore\Microsoft.Azure.Commands.Sql.dll</HintPath>
42+
</Reference>
43+
<Reference Include="Microsoft.Azure.Management.Sql.Legacy">
44+
<HintPath>..\..\..\Package\$(Configuration)\ResourceManager\AzureResourceManager\AzureRM.Sql.Netcore\Microsoft.Azure.Management.Sql.Legacy.dll</HintPath>
45+
</Reference>
46+
</ItemGroup>
47+
4148
<ItemGroup>
4249
<None Update="SessionRecords\**\*.json">
4350
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -47,4 +54,13 @@
4754
</None>
4855
</ItemGroup>
4956

57+
<ItemGroup>
58+
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
59+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60+
</None>
61+
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Storage.ps1">
62+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
63+
</None>
64+
</ItemGroup>
65+
5066
</Project>

0 commit comments

Comments
 (0)