gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
172 stars 42 forks source link

Pester output format can't be set to JUnitXml #292

Closed NicolasBn closed 3 years ago

NicolasBn commented 3 years ago

Details of the scenario you tried and the problem that is occurring

When you set JUnitXML on build.yml, the Invoke_Pester_Tests_V4 task doesn't take it.

image

Verbose logs showing the problem

I added a line to show the content of $PesterOutPutFormat on the top of task : image

And after the section of build variable : image

Suggested solution to the issue

No idea ...

The operating system the target node is running

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2004
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : fr-FR
OsMuiLanguages       : {fr-FR, en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
NicolasBn commented 3 years ago

Yaml file is correctly imported in build.ps1 :

image

johlju commented 3 years ago

Probably the variable is passed from the parent scope so this row is returning NUnitXML using property. Is another task setting to the wrong value? If that returns a value then that will override build configuration.

https://github.com/gaelcolas/Sampler/blob/184c8f6ee27803e76024ac39754496b133e7d860/.build/tasks/Invoke-Pester.pester.build.ps1#L31

johlju commented 3 years ago

Is it this default value that messes up things?

https://github.com/gaelcolas/Sampler/blob/184c8f6ee27803e76024ac39754496b133e7d860/.build/tasks/DeployAll.PSDeploy.build.ps1#L12

NicolasBn commented 3 years ago

Oh yeah ! That's it !

I clear the value and now the PesterOutPutFormat value is good.

Thank @johlju