Skip to content

Commit 4a5bb57

Browse files
Merge pull request Azure#8788 from sanjkuma/sanjkuma/ADF-git-config
Added new parameters and parametersets to Set-AzDataFactoryV2 cmdlet
2 parents 8ab4b5f + 6ba8a02 commit 4a5bb57

File tree

13 files changed

+1978
-12
lines changed

13 files changed

+1978
-12
lines changed

src/DataFactory/DataFactoryV2.Test/ScenarioTests/DataFactoryTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ public void TestCreateDataFactoryV2()
4949
RunPowerShellTest(_logger, "Test-CreateDataFactory");
5050
}
5151

52+
[Fact]
53+
[Trait(Category.AcceptanceType, Category.CheckIn)]
54+
public void TestCreateDataFactoryV2WithVSTSRepoConfig()
55+
{
56+
RunPowerShellTest(_logger, "Test-CreateDataFactoryV2WithVSTSRepoConfig");
57+
}
58+
59+
[Fact]
60+
[Trait(Category.AcceptanceType, Category.CheckIn)]
61+
public void TestCreateDataFactoryV2WithGitHubRepoConfig()
62+
{
63+
RunPowerShellTest(_logger, "Test-CreateDataFactoryV2WithGitHubRepoConfig");
64+
}
65+
5266
[Fact]
5367
[Trait(Category.AcceptanceType, Category.CheckIn)]
5468
public void TestDeleteDataFactoryWithDataFactoryParameterV2()

src/DataFactory/DataFactoryV2.Test/ScenarioTests/DataFactoryTests.ps1

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,55 @@ function ValidateFactoryProperties ($expected, $actual)
181181
Assert-AreEqualObjectProperties $expected $actual
182182
}
183183

184+
<#
185+
.SYNOPSIS
186+
Creates a data factory with VSTS repo config and then does a Get to verify that both are identical.
187+
#>
188+
function Test-CreateDataFactoryV2WithVSTSRepoConfig
189+
{
190+
$dfname = Get-DataFactoryName
191+
$rgname = Get-ResourceGroupName
192+
$rglocation = Get-ProviderLocation ResourceManagement
193+
$dflocation = Get-ProviderLocation DataFactoryManagement
194+
195+
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
196+
197+
try
198+
{
199+
$actual = Set-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname -Location $dflocation -Force -AccountName "an" -RepositoryName "rn" -CollaborationBranch "cb" -RootFolder "rf" -LastCommitId "lci" -ProjectName "pn"
200+
$expected = Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname
201+
202+
ValidateFactoryProperties $expected $actual
203+
}
204+
finally
205+
{
206+
CleanUp $rgname $dfname
207+
}
208+
}
209+
210+
<#
211+
.SYNOPSIS
212+
Creates a data factory with VSTS repo config and then does a Get to verify that both are identical.
213+
#>
214+
function Test-CreateDataFactoryV2WithGitHubRepoConfig
215+
{
216+
$dfname = Get-DataFactoryName
217+
$rgname = Get-ResourceGroupName
218+
$rglocation = Get-ProviderLocation ResourceManagement
219+
$dflocation = Get-ProviderLocation DataFactoryManagement
220+
221+
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
222+
223+
try
224+
{
225+
$actual = Set-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname -Location $dflocation -Force -AccountName "an" -RepositoryName "rn" -CollaborationBranch "cb" -RootFolder "rf" -LastCommitId "lci" -HostName "hn"
226+
$expected = Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname
227+
228+
ValidateFactoryProperties $expected $actual
229+
}
230+
finally
231+
{
232+
CleanUp $rgname $dfname
233+
}
234+
}
235+

0 commit comments

Comments
 (0)