Skip to content

Commit

Permalink
DscResources.Common in submodule instead of GPRegistryPolicyDsc.Common (
Browse files Browse the repository at this point in the history
#31)

- Added DscResources.Common in submodule instead of GPRegistryPolicyDsc.Common (issue #30).
- Removed GPRegistryPolicyDsc.Common submodule issue #30) and its pester tests.
- Fixed azure Devops pipeline.
  • Loading branch information
NicolasBn authored Nov 3, 2023
1 parent 2bf81c9 commit db252f6
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 1,115 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added DscResources.Common in submodule instead of GPRegistryPolicyDsc.Common [issue#30](https://github.com/dsccommunity/GPRegistryPolicyDsc/issues/30).

### Removed

- Removed GPRegistryPolicyDsc.Common submodule [issue#30](https://github.com/dsccommunity/GPRegistryPolicyDsc/issues/30) and its pester tests.

### Fixed

- Fixed azure Devops pipeline.

## [1.3.1] - 2023-11-03

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ prefixed with just 'Sql'

Helper functions that are only used by one resource
so preferably be put in the same script file as the resource.
Helper function that can used by more than one resource can preferably
be placed in the resource module file [GPRegistryPolicyDsc.Common](/source/Modules/GPRegistryPolicyDsc.Common/GPRegistryPolicyDsc.Common.psm1).
Helper function that can used by more than one resource can be
placed in a resource module file GPRegistryPolicyDsc.Common or
preferably in the common module [DscResource.Common](https://github.com/dsccommunity/DscResource.Common).

### Documentation with Markdown

Expand Down
1 change: 1 addition & 0 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'Sampler.GitHubTasks' = 'latest'
MarkdownLinkCheck = 'latest'
'DscResource.Test' = 'latest'
'DscResource.Common' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
'DscResource.DocGenerator' = 'latest'
Expand Down
6 changes: 4 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variables:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
testArtifactName: testResults
testArtifactName: 'testResults_$(System.JobAttempt)'
sourceFolderName: source
defaultBranch: master

Expand Down Expand Up @@ -71,6 +71,7 @@ stages:
- task: PowerShell@2
name: test
displayName: 'Run HQRM Test'
condition: succeededOrFailed()
inputs:
filePath: './build.ps1'
arguments: '-Tasks hqrmtest'
Expand All @@ -80,7 +81,7 @@ stages:
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'HQRM'

- job: Test_Unit
Expand Down Expand Up @@ -111,6 +112,7 @@ stages:
testRunTitle: 'Unit'
- task: PublishPipelineArtifact@1
displayName: 'Publish Test Artifact'
condition: succeededOrFailed()
inputs:
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
Expand Down
12 changes: 12 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,24 @@ BuildWorkflow:
- Publish_Release_To_GitHub
- Publish_GitHub_Wiki_Content

####################################################
# Dependent Modules Configuration (Sampler) #
####################################################
NestedModule:
DscResource.Common:
CopyOnly: true
Path: ./output/RequiredModules/DscResource.Common
AddToManifest: false
Exclude: PSGetModuleInfo.xml

####################################################
# PESTER Configuration #
####################################################

Pester:
OutputFormat: NUnitXML
ExcludeFromCodeCoverage:
- Modules/DscResource.Common
Script:
- tests/Unit
ExcludeTag:
Expand All @@ -64,6 +75,7 @@ DscTest:
ExcludeSourceFile:
- output
ExcludeModuleFile:
- Modules/DscResource.Common
MainGitBranch: master

ModuleBuildTasks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules'
$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.Common'

$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'GPRegistryPolicyDsc.Common'
Import-Module -Name (Join-Path -Path $script:resourceHelperModulePath -ChildPath 'GPRegistryPolicyDsc.Common.psm1')
Import-Module -Name $script:resourceHelperModulePath

$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_RefreshRegistryPolicy'
$script:localizedData = Get-LocalizedData -DefaultUICulture en-US

<#
.SYNOPSIS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using module ..\..\Modules\GPRegistryPolicyFileParser
$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules'
$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'GPRegistryPolicyDsc.Common'
$script:GPRegistryPolicyFileParserModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'GPRegistryPolicyFileParser'
Import-Module -Name (Join-Path -Path $script:resourceHelperModulePath -ChildPath 'GPRegistryPolicyDsc.Common.psm1')
Import-Module -Name (Join-Path -Path $script:GPRegistryPolicyFileParserModulePath -ChildPath 'GPRegistryPolicyFileParser.psm1')
$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.Common'

$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_RegistryPolicyFile'
Import-Module -Name $script:GPRegistryPolicyFileParserModulePath
Import-Module -Name $script:resourceHelperModulePath

$script:localizedData = Get-LocalizedData -DefaultUICulture en-US

<#
.SYNOPSIS
Expand Down Expand Up @@ -297,7 +298,7 @@ function Test-TargetResource
'Ensure'
)

$testTargetResourceResult = Test-DscParameterState -CurrentValues $getTargetResourceResult -DesiredValues $PSBoundParameters -ValuesToCheck $valuesToCheck
$testTargetResourceResult = DSCResource.Common\Test-DscParameterState -CurrentValues $getTargetResourceResult -DesiredValues $PSBoundParameters -Properties $valuesToCheck -TurnOffTypeChecking
}
else
{
Expand Down

This file was deleted.

Loading

0 comments on commit db252f6

Please sign in to comment.