From fb45ad04e4abfa9ffd00195e93d5e3d51c12790c Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Thu, 1 Feb 2024 19:22:25 +0100 Subject: [PATCH] Fix missing commands in bootstrap script (#5) --- CHANGELOG.md | 1 + azure-pipelines.yml | 4 ++++ tests/Integration/Bootstrap.Integration.Tests.ps1 | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e20a24..b56282a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Status badges updated. +- Update integration tests for the bootstrap script. ### Added diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bdaec29..533b923 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,6 +10,10 @@ trigger: - "v*" exclude: - "*-*" +pr: +- main + autoCancel: false + drafts: true variables: buildFolderName: output diff --git a/tests/Integration/Bootstrap.Integration.Tests.ps1 b/tests/Integration/Bootstrap.Integration.Tests.ps1 index ab7f705..d7f537f 100644 --- a/tests/Integration/Bootstrap.Integration.Tests.ps1 +++ b/tests/Integration/Bootstrap.Integration.Tests.ps1 @@ -34,6 +34,11 @@ Describe 'Bootstrap Script' -Tag 'BootstrapScript' { Get-Module -Name 'PSResourceGet.Bootstrap' -All | Should -BeNullOrEmpty } + It 'Should not have DscResource.Common module available' { + Remove-Item -Path './output/RequiredModules/DscResource.Common' -Recurse -Force + Get-Module -Name 'DscResource.Common' -ListAvailable | Should -BeNullOrEmpty -Because 'If the module is available there can be false positive tests.' + } + Context 'When using Scope parameter set' { It 'Should bootstrap the module to the specified scope' { { & ./output/bootstrap.ps1 -Scope 'AllUsers' -Force -Verbose } | Should -Not -Throw