File tree Expand file tree Collapse file tree 6 files changed +37
-2
lines changed
Expand file tree Collapse file tree 6 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ The main advantage of the module is the ability to publish all the Azure Data Fa
2323* Tokenisation in config file allows replace any value by Environment Variable or Variable from DevOps Pipeline
2424 * (new!) Allows to define multiple file (objects) by wildcarding
2525* Global Parameters
26-
26+ * Support for Managed VNET and Managed Private Endpoint (new!)
27+
2728The following features coming in the future:
2829* Build function to support validation of files, dependencies and config
2930* Unit Tests of selected Pipelines and Linked Services
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) .
66
7+ ## [ 0.75.0] - 2021-08-05
8+ * Fixed ` Test-AdfCode ` when validating empty factory #125
9+
710## [ 0.74.0] - 2021-08-03
811* Cmdlet ` Test-AdfCode ` validates config files #62
912* Support configuration for Managed Private Endpoint #95
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ function Test-AdfCode {
8484 }
8585 }
8686
87- if ($adf.Factories.Count -gt 0 ) {
87+ if ($adf.Factories.Count -gt 0 -and ( Get-Member - InputObject $adf .Factories [ 0 ].Body - name " properties " - Membertype " Properties " ) ) {
8888 Get-Member - InputObject $adf.Factories [0 ].Body.properties.globalParameters - Membertype " NoteProperty" | ForEach-Object {
8989 [string ] $name = $_.Name
9090 if ($name.Contains (' -' )) {
@@ -98,9 +98,11 @@ function Test-AdfCode {
9898 Write-Host " === Validating config files ..."
9999 if (! $ConfigPath ) {
100100 $filePattern = Join-Path - Path $adf.Location - ChildPath ' deployment\*'
101+ if (! (Test-Path $filePattern )) { $filePattern = $null }
101102 } else {
102103 $filePattern = $ConfigPath -split ' ,'
103104 }
105+
104106 $files = Get-ChildItem - Path $filePattern - Include ' *.csv' , ' *.json'
105107 $err = $null
106108 $adf.PublishOptions.FailsWhenConfigItemNotFound = $True
Original file line number Diff line number Diff line change 1+ BeforeDiscovery {
2+ $ModuleRootPath = $PSScriptRoot | Split-Path - Parent
3+ $moduleManifestName = ' azure.datafactory.tools.psd1'
4+ $moduleManifestPath = Join-Path - Path $ModuleRootPath - ChildPath $moduleManifestName
5+
6+ Import-Module - Name $moduleManifestPath - Force - Verbose:$false
7+ }
8+
9+ InModuleScope azure.datafactory.tools {
10+ $testHelperPath = $PSScriptRoot | Join-Path - ChildPath ' TestHelper'
11+ Import-Module - Name $testHelperPath - Force
12+
13+ # Variables for use in tests
14+
15+ Describe ' Test-AdfCode' - Tag ' Unit' {
16+ It ' Should run successfully even for empty factory' {
17+ $DataFactoryName = " emptyFactory"
18+ $RootFolder = Join-Path - Path $PSScriptRoot - ChildPath $DataFactoryName
19+ { Test-AdfCode $RootFolder } | Should -Not - Throw
20+ }
21+
22+
23+
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " emptyFactory" ,
3+ "location" : " EastUS"
4+ }
You can’t perform that action at this time.
0 commit comments