-
Notifications
You must be signed in to change notification settings - Fork 4k
Add Data Sync PowerShell Cmdlets to Azure.SQL #4037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fb5e65d
Add Data Sync Legacy SDK
fhljys 89e2b92
Add Data Sync PowerShell Cmdlets
fhljys c1fb0de
Add test cases and session records for Data Sync PowerShell Cmdlets
fhljys 59a1baf
Update session records, Update test cases, Update help.xml
fhljys cf01bba
Update Sync Agent Creation Code and Session Records
e467f9c
resolve comments
aac3a5c
Resolve comments
55aab78
Merge remote-tracking branch 'refs/remotes/upstream/preview'
3dc64f8
Update help doc
22d6568
Update help doc xml
7ce9e74
Add alias, make some parameters positional.
ba7df38
Change DatabaseType to MemberDatabaseType, HubDatabaseCredential to D…
4330ea3
Add additional parameter set of sync agent resource id and sync datab…
ebf9782
Update tests and session records
e7cc67e
Merge remote-tracking branch 'upstream/preview' into fang-datasync
10a7099
Fix conflict of clientRequestId
a203f7a
Provide table view for syncGroup, syncMember, syncAgent and linkedDat…
5848fe7
Revert test framework upgrade
05bca5f
Merge remote-tracking branch 'refs/remotes/upstream/preview'
16e0ab7
Resolve comments
1c859e3
Resolve comments
d582370
Merge remote-tracking branch 'refs/remotes/upstream/preview'
2c87d78
Resolve comments --- except remove cmdlets
2da71b0
Fix remove cmdlets
1310355
Update session records
b4c2966
Merge remote-tracking branch 'refs/remotes/upstream/preview'
9549223
Update changelog
cf2c19d
Update Remove cmdlets and changelog
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,14 +356,24 @@ function Remove-ResourceGroupForTest ($rg) | |
|
||
<# | ||
.SYNOPSIS | ||
Creates the test environment needed to perform the Sql server CRUD tests | ||
Gets the server credential | ||
#> | ||
function Create-ServerForTest ($resourceGroup, $serverVersion = "12.0", $location = "Japan East") | ||
function Get-ServerCredential | ||
{ | ||
$serverName = Get-ServerName | ||
$serverLogin = "testusername" | ||
$serverPassword = "t357ingP@s5w0rd!" | ||
$credentials = new-object System.Management.Automation.PSCredential($serverLogin, ($serverPassword | ConvertTo-SecureString -asPlainText -Force)) | ||
return $credentials | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Creates the test environment needed to perform the Sql server CRUD tests | ||
#> | ||
function Create-ServerForTest ($resourceGroup, $serverVersion = "12.0", $location = "Japan East") | ||
{ | ||
$serverName = Get-ServerName | ||
$credentials = Get-ServerCredential | ||
|
||
$server = New-AzureRmSqlServer -ResourceGroupName $resourceGroup.ResourceGroupName -ServerName $serverName -Location $location -ServerVersion $serverVersion -SqlAdministratorCredentials $credentials | ||
return $server | ||
|
@@ -456,4 +466,55 @@ function Get-SqlDatabaseImportExportTestEnvironmentParameters ($testSuffix) | |
databaseMaxSizeBytes = "5000000"; | ||
authType = "Sql"; | ||
} | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Gets valid sync group name | ||
#> | ||
function Get-SyncGroupName | ||
{ | ||
return getAssetName | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Gets valid sync member name | ||
#> | ||
function Get-SyncMemberName | ||
{ | ||
return getAssetName | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Gets valid sync agent name | ||
#> | ||
function Get-SyncAgentName | ||
{ | ||
return getAssetName | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Gets the values of the parameters used by the sync group tests | ||
#> | ||
function Get-SqlSyncGroupTestEnvironmentParameters ($testSuffix) | ||
{ | ||
return @{ | ||
intervalInSeconds = 300; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: fix indentation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
conflictResolutionPolicy = "HubWin"; | ||
} | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Gets the values of the parameters used by the sync member tests | ||
#> | ||
function Get-SqlSyncMemberTestEnvironmentParameters ($testSuffix) | ||
{ | ||
return @{ | ||
syncDirection = "Bidirectional"; | ||
databaseType = "AzureSqlDatabase"; | ||
} | ||
} |
135 changes: 135 additions & 0 deletions
135
src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataSyncTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// 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.Commands.ScenarioTest.SqlTests; | ||
using Microsoft.Azure.ServiceManagemenet.Common.Models; | ||
using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests | ||
{ | ||
public class DataSyncTests : SqlTestsBase | ||
{ | ||
public DataSyncTests(ITestOutputHelper output) : base(output) | ||
{ | ||
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output)); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncAgentCreate() | ||
{ | ||
RunPowerShellTest("Test-CreateSyncAgent"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncAgentsGetAndList() | ||
{ | ||
RunPowerShellTest("Test-GetAndListSyncAgents"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncAgentRemove() | ||
{ | ||
RunPowerShellTest("Test-RemoveSyncAgent"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncAgentKeyCreate() | ||
{ | ||
RunPowerShellTest("Test-CreateSyncAgentKey"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncAgentLinkedDatabaseList() | ||
{ | ||
RunPowerShellTest("Test-listSyncAgentLinkedDatabase"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncGroupCreate() | ||
{ | ||
RunPowerShellTest("Test-CreateSyncGroup"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncGroupUpdate() | ||
{ | ||
RunPowerShellTest("Test-UpdateSyncGroup"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncGroupsGetAndList() | ||
{ | ||
RunPowerShellTest("Test-GetAndListSyncGroups"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncGroupHubSchemaRefreshAndGet() | ||
{ | ||
RunPowerShellTest("Test-RefreshAndGetSyncGroupHubSchema"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncGroupRemove() | ||
{ | ||
RunPowerShellTest("Test-RemoveSyncGroup"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncMemberCreate() | ||
{ | ||
RunPowerShellTest("Test-CreateSyncMember"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncMembersGetAndList() | ||
{ | ||
RunPowerShellTest("Test-GetAndListSyncMembers"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncMemberUpdate() | ||
{ | ||
RunPowerShellTest("Test-UpdateSyncMember"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncMemberSchemaRefreshAndGet() | ||
{ | ||
RunPowerShellTest("Test-RefreshAndGetSyncMemberSchema"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestSyncMemberRemove() | ||
{ | ||
RunPowerShellTest("Test-RemoveSyncMember"); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See name change below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok