From 80172377320659488f0b45595264c29da58ae448 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Fri, 7 Sep 2018 08:26:57 +0200 Subject: [PATCH] Opt-in for common test 'Common Tests - Relative Path Length' (#1217) --- .MetaTestOptIn.json | 3 ++- CHANGELOG.md | 1 + Tests/SqlServerDscCommon.Tests.ps1 | 28 ---------------------------- 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 Tests/SqlServerDscCommon.Tests.ps1 diff --git a/.MetaTestOptIn.json b/.MetaTestOptIn.json index 352ed6f15..146c01c2a 100644 --- a/.MetaTestOptIn.json +++ b/.MetaTestOptIn.json @@ -6,5 +6,6 @@ "Common Tests - Required Script Analyzer Rules", "Common Tests - New Error-Level Script Analyzer Rules", "Common Tests - Custom Script Analyzer Rules", - "Common Tests - Validate Markdown Links" + "Common Tests - Validate Markdown Links", + "Common Tests - Relative Path Length" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 0389bd456..d39fc1661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ rules, both in Visual Studio Code and directly using `Invoke-ScriptAnalyzer`. - Opt-in for common test "Common Tests - Validate Markdown Links". - Updated broken links in `\README.md` and in `\Examples\README.md` + - Opt-in for common test 'Common Tests - Relative Path Length'. - Changes to SqlAg, SqlAGDatabase, and SqlAGReplica examples - Included configuration for SqlAlwaysOnService to enable HADR on each node to avoid confusion diff --git a/Tests/SqlServerDscCommon.Tests.ps1 b/Tests/SqlServerDscCommon.Tests.ps1 deleted file mode 100644 index 9fb391035..000000000 --- a/Tests/SqlServerDscCommon.Tests.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$script:moduleRoot = Split-Path $PSScriptRoot -Parent - -Describe 'SqlServerDsc module common tests' { - Context -Name 'When the resource should be used to compile a configuration in Azure Automation' { - $fullPathHardLimit = 129 # 129 characters is the current maximum for a relative path to be able to compile configurations in Azure Automation. - $allModuleFiles = Get-ChildItem -Path $script:moduleRoot -Recurse - - $testCaseModuleFile = @() - $allModuleFiles | ForEach-Object -Process { - $testCaseModuleFile += @( - @{ - FullRelativePath = $_.FullName -replace ($script:moduleRoot -replace '\\','\\') - } - ) - } - - It 'The length of the full path '''' should not exceed the max hard limit' -TestCases $testCaseModuleFile { - param - ( - [Parameter()] - [System.String] - $FullRelativePath - ) - - $FullRelativePath.Length | Should -Not -BeGreaterThan $fullPathHardLimit - } - } -}