diff --git a/CHANGELOG.md b/CHANGELOG.md index 4346199..07febef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Set `testRunTitle` for PublishTestResults steps so that a helpful name is displayed in Azure DevOps for each test run. - Set a display name on all the jobs and tasks in the CI - pipeline - fixes [issue #63](https://github.com/PowerShell/WSManDsc/issues/63) + pipeline - fixes [issue #63](https://github.com/dsccommunity/WSManDsc/issues/63) ### Deprecated @@ -49,6 +49,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 README.md. - WSManListener - Fix Find-Certificate Verbose Messages [Issue #49](https://github.com/dsccommunity/WSManDsc/issues/49). +- Fixed `GitVersion.yml` feature and fix Regex - fixes + [issue #62](https://github.com/dsccommunity/WSManDsc/issues/62). +- Fix import statement in all tests, making sure it throws if module + DscResource.Test cannot be imported - fixes + [issue #67](https://github.com/dsccommunity/WSManDsc/issues/67). +- Fix deploy stage in CI pipeline to prevent it executing against forks + of the repository - fixes [issue #66](https://github.com/dsccommunity/WSManDsc/issues/66). ### Security diff --git a/GitVersion.yml b/GitVersion.yml index 938b3c9..f011744 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -13,12 +13,12 @@ branches: feature: tag: useBranchName increment: Minor - regex: f(eature(s)?)?[/-] + regex: f(eature(s)?)?\/-] source-branches: ['master'] hotfix: tag: fix increment: Patch - regex: (hot)?fix(es)?[/-] + regex: (hot)?fix(es)?[\/-] source-branches: ['master'] ignore: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4403977..cf3cbfc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -159,14 +159,14 @@ stages: - stage: Deploy dependsOn: Test - # Only execute deploy stage if we're on master and previous stage succeeded condition: | and( succeeded(), or( eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/') - ) + ), + contains(variables['System.TeamFoundationCollectionUri'], 'dsccommunity') ) jobs: - job: Deploy_Module diff --git a/tests/Integration/DSC_WSManConfig.Integration.Tests.ps1 b/tests/Integration/DSC_WSManConfig.Integration.Tests.ps1 index 1ade8e3..3207ddb 100644 --- a/tests/Integration/DSC_WSManConfig.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WSManConfig.Integration.Tests.ps1 @@ -3,7 +3,7 @@ $script:dscResourceName = 'DSC_WSManConfig' $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) -Import-Module -Name DscResource.Test -Force +Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` diff --git a/tests/Integration/DSC_WSManListener.Integration.Tests.ps1 b/tests/Integration/DSC_WSManListener.Integration.Tests.ps1 index b8052d5..033a1b8 100644 --- a/tests/Integration/DSC_WSManListener.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WSManListener.Integration.Tests.ps1 @@ -3,7 +3,7 @@ $script:dscResourceName = 'DSC_WSManListener' $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) -Import-Module -Name DscResource.Test -Force +Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` diff --git a/tests/Integration/DSC_WSManServiceConfig.Integration.Tests.ps1 b/tests/Integration/DSC_WSManServiceConfig.Integration.Tests.ps1 index 1a97726..aa5a16d 100644 --- a/tests/Integration/DSC_WSManServiceConfig.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WSManServiceConfig.Integration.Tests.ps1 @@ -3,7 +3,7 @@ $script:dscResourceName = 'DSC_WSManServiceConfig' $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) -Import-Module -Name DscResource.Test -Force +Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` diff --git a/tests/Unit/DSC_WSManConfig.Tests.ps1 b/tests/Unit/DSC_WSManConfig.Tests.ps1 index c5673df..a36fcbe 100644 --- a/tests/Unit/DSC_WSManConfig.Tests.ps1 +++ b/tests/Unit/DSC_WSManConfig.Tests.ps1 @@ -7,7 +7,7 @@ $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) function Invoke-TestSetup { - Import-Module -Name DscResource.Test -Force + Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` diff --git a/tests/Unit/DSC_WSManListener.Tests.ps1 b/tests/Unit/DSC_WSManListener.Tests.ps1 index 75f842f..c267098 100644 --- a/tests/Unit/DSC_WSManListener.Tests.ps1 +++ b/tests/Unit/DSC_WSManListener.Tests.ps1 @@ -7,7 +7,7 @@ $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) function Invoke-TestSetup { - Import-Module -Name DscResource.Test -Force + Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` diff --git a/tests/Unit/DSC_WSManServiceConfig.Tests.ps1 b/tests/Unit/DSC_WSManServiceConfig.Tests.ps1 index 36d3d2b..c69162b 100644 --- a/tests/Unit/DSC_WSManServiceConfig.Tests.ps1 +++ b/tests/Unit/DSC_WSManServiceConfig.Tests.ps1 @@ -7,7 +7,7 @@ $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) function Invoke-TestSetup { - Import-Module -Name DscResource.Test -Force + Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' $script:testEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName `