Skip to content

Commit 71700b3

Browse files
committed
Readded classic (obsolete) calls for DataLakeAnalytics in desktop so tests could pass (specifically AdlaTests.TestAdlaCatalog and AdlaAliasTests.TestAdlaCatalog). Made keyvault pshtest.pfx ALWAYS copy (in CI, it sometimes wouldn't copy???). Altered setup of 2 Sql tests and linked to issue.
1 parent b387a36 commit 71700b3

File tree

4 files changed

+43
-4
lines changed

4 files changed

+43
-4
lines changed

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Models/DataLakeAnalyticsClient.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,30 +491,49 @@ public List<FirewallRule> ListFirewallRules(string resourceGroupName, string acc
491491
public void CreateSecret(string accountName, string databaseName,
492492
string secretName, string password, string hostUri)
493493
{
494+
#if NETSTANDARD
494495
_catalogClient.Catalog.CreateCredential(accountName, databaseName, secretName,
495496
new DataLakeAnalyticsCatalogCredentialCreateParameters
496497
{
497498
Password = password,
498499
Uri = hostUri
499500
});
501+
#else
502+
_catalogClient.Catalog.CreateSecret(accountName, databaseName, secretName,
503+
new DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters
504+
{
505+
Password = password,
506+
Uri = hostUri
507+
});
508+
#endif
500509
}
501510

502511
public USqlSecret UpdateSecret(string accountName, string databaseName,
503512
string secretName, string password, string hostUri)
504513
{
514+
#if NETSTANDARD
505515
_catalogClient.Catalog.UpdateCredential(accountName, databaseName, secretName,
506516
new DataLakeAnalyticsCatalogCredentialUpdateParameters
507517
{
508518
Password = password,
509519
Uri = hostUri
510520
});
521+
#else
522+
_catalogClient.Catalog.UpdateSecret(accountName, databaseName, secretName,
523+
new DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters
524+
{
525+
Password = password,
526+
Uri = hostUri
527+
});
528+
#endif
511529

512530
// TODO: Remove this during the next breaking change release.
513531
return null;
514532
}
515533

516534
public void DeleteSecret(string accountName, string databaseName, string secretName)
517535
{
536+
#if NETSTANDARD
518537
if (string.IsNullOrEmpty(secretName))
519538
{
520539
var credentials = _catalogClient.Catalog.ListCredentials(accountName, databaseName);
@@ -527,6 +546,16 @@ public void DeleteSecret(string accountName, string databaseName, string secretN
527546
{
528547
_catalogClient.Catalog.DeleteCredential(accountName, databaseName, secretName);
529548
}
549+
#else
550+
if (string.IsNullOrEmpty(secretName))
551+
{
552+
_catalogClient.Catalog.DeleteAllSecrets(accountName, databaseName);
553+
}
554+
else
555+
{
556+
_catalogClient.Catalog.DeleteSecret(accountName, databaseName, secretName);
557+
}
558+
#endif
530559
}
531560

532561

src/ResourceManager/DataLakeAnalytics/DataLakeAnalytics.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27428.2037
3+
VisualStudioVersion = 15.0.27130.2027
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
66
EndProject
@@ -44,6 +44,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.KeyVault",
4444
EndProject
4545
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.WebSites", "..\..\Common\Commands.Common.Websites\Commands.Common.WebSites.csproj", "{592B3E1B-49E3-4F3C-BF6B-E5D4133B1443}"
4646
EndProject
47+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.DataLakeStore", "..\DataLakeStore\Commands.DataLakeStore\Commands.DataLakeStore.csproj", "{8AAB43E6-E8F6-4F91-AF8A-6A63CD78EF1E}"
48+
EndProject
4749
Global
4850
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4951
Debug|Any CPU = Debug|Any CPU
@@ -130,6 +132,10 @@ Global
130132
{592B3E1B-49E3-4F3C-BF6B-E5D4133B1443}.Debug|Any CPU.Build.0 = Debug|Any CPU
131133
{592B3E1B-49E3-4F3C-BF6B-E5D4133B1443}.Release|Any CPU.ActiveCfg = Release|Any CPU
132134
{592B3E1B-49E3-4F3C-BF6B-E5D4133B1443}.Release|Any CPU.Build.0 = Release|Any CPU
135+
{8AAB43E6-E8F6-4F91-AF8A-6A63CD78EF1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
136+
{8AAB43E6-E8F6-4F91-AF8A-6A63CD78EF1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
137+
{8AAB43E6-E8F6-4F91-AF8A-6A63CD78EF1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
138+
{8AAB43E6-E8F6-4F91-AF8A-6A63CD78EF1E}.Release|Any CPU.Build.0 = Release|Any CPU
133139
EndGlobalSection
134140
GlobalSection(SolutionProperties) = preSolution
135141
HideSolutionNode = FALSE

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
<SubType>Designer</SubType>
181181
</None>
182182
<None Include="Resources\pshtest.pfx">
183-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
183+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
184184
</None>
185185
<None Include="ScenarioTests\Common.ps1">
186186
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseReplicationTests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ function Test-CreateVcoreDatabaseCopy()
121121
function Test-CreateSecondaryDatabase()
122122
{
123123
# Setup
124-
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
124+
# https://github.com/Azure/azure-powershell/issues/6382
125+
#$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
126+
$location = 'Southeast Asia'
125127
$rg = Create-ResourceGroupForTest $location
126128
$server = Create-ServerForTest $rg $location
127129
$database = Create-DatabaseForTest $rg $server
@@ -162,7 +164,9 @@ function Test-CreateSecondaryDatabase()
162164
function Test-GetReplicationLink()
163165
{
164166
# Setup
165-
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
167+
# https://github.com/Azure/azure-powershell/issues/6382
168+
#$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
169+
$location = 'Southeast Asia'
166170
$rg = Create-ResourceGroupForTest $location
167171
$server = Create-ServerForTest $rg $location
168172
$database = Create-DatabaseForTest $rg $server

0 commit comments

Comments
 (0)