Closed dgee2 closed 6 years ago
That looks like it's importing pester 3.4 instead of the specified version. I'll have a look into this a bit later as we should have fixed this with the last release.
From: Daniel Gee notifications@github.com Sent: Sunday, January 14, 2018 12:31:30 AM To: rfennell/vNextBuild Cc: Subscribed Subject: [rfennell/vNextBuild] Pester doesn't work on Hosted VS2017 queues (#243)
VSTS Extension you are using
Pester
Where are you running it?
VSTS
Version of Extension/Task
current public - 6.*
Expected behaviour and actual behaviour
When running the task against the "Hosted VS2017" agents with the task set to use v4.0.8 of Pester, I receive the following errors
I believe that Pester is now included on the Hosted VS2017 build agents and therefore this line is not actually importing the module: Import-Module -Name $moduleFolder\Pester.psd1https://github.com/rfennell/vNextBuild/blob/543a52a8c0478e57a91a03692ef02db4b1d00d75/Extensions/Pester/task/Pester.ps1#L88 I guess adding -Force on the end may fix this
Preparing task execution handler. Executing the powershell script: d:\a_tasks\Pester_31ef0033-64e3-4c55-b888-f446541474a6\6.1.36\Pester.ps1
Describing ConvertTo-DigitalAction
Context Passed Single rawObject
[-] Parses Id correctly 5.21s
RuntimeException: '-Be' is not a valid Should operator.
at Get-TestResult, C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Assertions\Should.ps1: line 42
at System.Management.Automation.ValidateEnumeratedArgumentsAttribute.Validate(Object arguments, EngineIntrinsics engineIntrinsics)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at ConvertTo-FailureLines
Passed: 6 Failed: 37 Skipped: 0 Pending: 0 Inconclusive: 0
Steps to reproduce the problem
Run Pester against any PS module on the Hosted VS2017 queue
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/rfennell/vNextBuild/issues/243, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQDqFqHQl45hHCCJCmdmC1LVlVspytvLks5tKUrigaJpZM4RdbJY.
@dgee2 could you run you build again with the system.debug build variable set to try so we get a detailed debug log.
We need to see the parameters being set on the task, and any other messages.
If the former what do you see when you force usage of pester 4.0.x from with task?
I ran my validation build against the current VS2017 and it did not error, whether or not I was picking the versions of Pester.
For now I would suggest you pick the option to used the 4.0.8 version included within the task while we look into the loading logic further
As per my standard practice I am closing this issue as I have heard nothing for a while and I think I have provides a solution/workaround.
If this issue remains a problem please do not hesitate to re-open it
VSTS Extension you are using
Pester
Where are you running it?
VSTS
Version of Extension/Task
current public - 6.*
Expected behaviour and actual behaviour
When running the task against the "Hosted VS2017" agents with the task set to use v4.0.8 of Pester, I receive the following errors
I believe that Pester is now included on the Hosted VS2017 build agents and therefore this line is not actually importing the module: Import-Module -Name $moduleFolder\Pester.psd1 I guess adding -Force on the end may fix this
Steps to reproduce the problem
Run Pester against any PS module on the Hosted VS2017 queue