gaelcolas / gaelcolas/DscInfraSample
Unable to run initial build due to failing tests
- Dominant language
- PowerShell
- Stars
- 49
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Hi Gael,
I have found your articles about this approach and this repositroy to very much link up with the biggest issue I have with DSC.
So thanks!!!
I am however seeing this issue when running the `build.ps1 -ResolveDependencies`. Apparently it is downloading pester 5 that comes with many breaking changes. :
```
WARNING: You are using Legacy parameter set that adapts Pester 5 syntax to Pester 4 syntax. This parameter set is
deprecated, and does not work 100%. The -Strict and -PesterOption parameters are ignored, and providing advanced
configuration to -Path (-Script), and -CodeCoverage via a hash table does not work. Please refer to
https://github.com/pester/Pester/releases/tag/5.0.1#legacy-parameter-set for more information.
Starting discovery in 1 files.
Discovery finished in 2.5s.
[-] Datum Tree Definition.Exists in DSC_ConfigData Folder 294ms (137ms|157ms)
ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:14
[-] Node Definition Files.AllNodes is not Empty 78ms (74ms|4ms)
Expected a value, but got $null or empty.
at $content | Should -Not -BeNullOrEmpty, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
[-] Node Definition Files.SRV01 Should not be duplicated 150ms (111ms|39ms)
Expected $false, but got $true.
at $nodeNames -contains $_.BaseName | Should -Be $false, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
[-] Node Definition Files.SRV01 is not Empty 15ms (12ms|3ms)
Expected a value, but got $null or empty.
at $content | Should -Not -BeNullOrEmpty, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
[-] Node Definition Files.SRV02 Should not be duplicated 12ms (9ms|3ms)
Expected $false, but got $true.
at $nodeNames -contains $_.BaseName | Should -Be $false, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
[-] Node Definition Files.SRV02 is not Empty 16ms (12ms|4ms)
Expected a value, but got $null or empty.
at $content | Should -Not -BeNullOrEmpty, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
[-] Node Definition Files.PRODSRV01 Should not be duplicated 18ms (14ms|4ms)
Expected $false, but got $true.
at $nodeNames -contains $_.BaseName | Should -Be $false, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:31
[-] Node Definition Files.PRODSRV01 is not Empty 10ms (7ms|3ms)
Expected a value, but got $null or empty.
at $content | Should -Not -BeNullOrEmpty, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:38
WARNING: No Datum store found for DSC Resource
[-] Role Composition.Nodes for environment DEV.SRV01 has a valid Configurations Setting (!$null) 269ms (266ms|2ms)
Expected no exception to be thrown, but an exception "The lookup of path 'Configurations' for node '' returned a Null value, but Null is not specified as Default. This is not allowed." was thrown from C:\Git\DscInfraSample\BuildOutput\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
at {Lookup Configurations -Node $node -DatumTree $datum } | Should -Not -Throw, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
WARNING: No Datum store found for DSC Resource
[-] Role Composition.Nodes for environment DEV.SRV02 has a valid Configurations Setting (!$null) 22ms (19ms|3ms)
Expected no exception to be thrown, but an exception "The lookup of path 'Configurations' for node '' returned a Null value, but Null is not specified as Default. This is not allowed." was thrown from C:\Git\DscInfraSample\BuildOutput\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
at {Lookup Configurations -Node $node -DatumTree $datum } | Should -Not -Throw, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
WARNING: No Datum store found for DSC Resource
[-] Role Composition.Nodes for environment PROD.SRV01 has a valid Configurations Setting (!$null) 20ms (18ms|2ms)
Expected no exception to be thrown, but an exception "The lookup of path 'Configurations' for node '' returned a Null value, but Null is not specified as Default. This is not allowed." was thrown from C:\Git\DscInfraSample\BuildOutput\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
at {Lookup Configurations -Node $node -DatumTree $datum } | Should -Not -Throw, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
WARNING: No Datum store found for DSC Resource
[-] Role Composition.Nodes for environment PROD.SRV02 has a valid Configurations Setting (!$null) 25ms (22ms|3ms)
Expected no exception to be thrown, but an exception "The lookup of path 'Configurations' for node '' returned a Null value, but Null is not specified as Default. This is not allowed." was thrown from C:\Git\DscInfraSample\BuildOutput\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
at {Lookup Configurations -Node $node -DatumTree $datum } | Should -Not -Throw, C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
at , C:\Git\DscInfraSample\Tests\01 ConfigData\ConfigData.Tests.ps1:67
Tests completed in 5.83s
Tests Passed: 9, Failed: 12, Skipped: 0 NotRun: 0
ERROR: Assertion failed.
At C:\Git\DscInfraSample\.Build.ps1:272 char:5
+ assert ($testResults.FailedCount -eq 0)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At C:\Git\DscInfraSample\.Build.ps1:259 char:1
+ task Test_ConfigData {
+ ~~~~~~~~~~~~~~~~~~~~~~
At C:\Git\DscInfraSample\.Build.ps1:204 char:5
+ task . Clean_BuildOutput,
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
WARNING: No Datum store found for DSC Resource Task: Test_ConfigData. File: C:\Git\DscInfraSample\.Build.ps1.
WARNING: No Datum store found for DSC Resource Task: Test_ConfigData. File: C:\Git\DscInfraSample\.Build.ps1.
WARNING: No Datum store found for DSC Resource Task: Test_ConfigData. File: C:\Git\DscInfraSample\.Build.ps1.
WARNING: No Datum store found for DSC Resource Task: Test_ConfigData. File: C:\Git\DscInfraSample\.Build.ps1.
Build FAILED. 7 tasks, 1 errors, 4 warnings 00:00:25.6782806
assert : Assertion failed.
At C:\Git\DscInfraSample\.Build.ps1:272 char:5
+ assert ($testResults.FailedCount -eq 0)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Assert-Build], Exception
+ FullyQualifiedErrorId : Assert-Build
```
I also see the following when attempting to run help:
```
PS C:\Git\DscInfraSample> .\.Build.ps1 -Help
Name Jobs Synopsis
---- ---- --------
Clean_BuildOutput {}
Clean_Module {}
PSModulePath_BuildModules {Download_All_Dependencies, {}}
Load_Datum_ConfigData {}
Compile_Root_Configuration {}
Compile_Root_Meta_Mof {}
Create_Mof_Checksums {}
Compile_Datum_Rsop {}
. {Clean_BuildOutput, PSModulePath_BuildModules, Test_ConfigData, Load_Datum_ConfigData...}
Download_All_Dependencies {Download_DSC_Configurations, Download_DSC_Resources}
Download_DSC_Resources {}
Download_DSC_Configurations {}
Clean_DSC_Resources_Folder {}
Clean_DSC_Configurations_Folder {}
Zip_Modules_For_Pull_Server {}
Test_ConfigData {}
Set-BuildHeader : The term 'Set-BuildHeader' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At C:\Git\DscInfraSample\.Build.ps1:189 char:5
+ Set-BuildHeader $TaskHeader
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-BuildHeader:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
task : The term 'task' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Git\DscInfraSample\.Build.ps1:204 char:5
+ task . Clean_BuildOutput,
+ ~~~~
+ CategoryInfo : ObjectNotFound: (task:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
task : The term 'task' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Git\DscInfraSample\.Build.ps1:217 char:1
+ task Download_All_Dependencies -if ($DownloadResourcesAndConfiguratio ...
+ ~~~~
+ CategoryInfo : ObjectNotFound: (task:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
task : The term 'task' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Git\DscInfraSample\.Build.ps1:224 char:1
+ task Download_DSC_Resources .....
```
Am I missing something?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with .Build.ps1, especially the dependency setup, Test_ConfigData task, and help path; compare the reported behavior from build.ps1 -ResolveDependencies and .Build.ps1 -Help. Review Tests/01 ConfigData/ConfigData.Tests.ps1 and the resolved test dependency, then verify that help runs without command errors and the initial build completes with all tests passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system, devops, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100