Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestDrive cannot be used in Azure DevOps #41

Open
emmanuelbenitez opened this issue Jun 29, 2020 · 4 comments
Open

TestDrive cannot be used in Azure DevOps #41

emmanuelbenitez opened this issue Jun 29, 2020 · 4 comments

Comments

@emmanuelbenitez
Copy link

Where are you running it?

Azure DevOps Service (VSTS)

Version of Extension/Task

10.1.23

Expected behaviour and actual behaviour

Actual behaviour

When the tests are using the TestDrive, all test failed due to an error in the temp registry initialization

System.Exception: Was not able to create a Pester Registry key for TestRegistry 
System.Management.Automation.ValidationMetadataException: The " $_ | Test-Path -PathType Leaf " validation script for 
the argument with value "Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Pester" did not return a 
result of True. Determine why the validation script failed, and then try the command again.
   at System.Management.Automation.ValidateScriptAttribute.ValidateElement(Object element)
   at System.Management.Automation.ValidateEnumeratedArgumentsAttribute.Validate(Object arguments, EngineIntrinsics 
engineIntrinsics)
   at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, 
CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
At C:\Users\VssAdministrator\Documents\WindowsPowerShell\Modules\Pester\5.0.2\Pester.psm1:7827 char:13
+             throw ([Exception]"Was not able to create a Pester Regist ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (System.Object[]:Object[]) [], RuntimeException
    + FullyQualifiedErrorId : System.Exception: Was not able to create a Pester Registry key for TestRegistry System.M 
   anagement.Automation.ValidationMetadataException: The " $_ | Test-Path -PathType Leaf " validation script for the   
  argument with value "Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Pester" did not return a resul   
 t of True. Determine why the validation script failed, and then try the command again.
   at System.Management.Automation.ValidateScriptAttribute.ValidateElement(Object element)
       at System.Management.Automation.ValidateEnumeratedArgumentsAttribute.Validate(Object arguments, EngineIntrinsic 
   s engineIntrinsics)
       at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledC 
   ommandParameter parameterMetadata, ParameterBindingFlags flags)
 at Get-TempRegistry, C:\Users\VssAdministrator\Documents\WindowsPowerShell\Modules\Pester\5.0.2\Pester.psm1: line 7827
at New-RandomTempRegistry, C:\Users\VssAdministrator\Documents\WindowsPowerShell\Modules\Pester\5.0.2\Pester.psm1: line 12890
at New-TestRegistry, C:\Users\VssAdministrator\Documents\WindowsPowerShell\Modules\Pester\5.0.2\Pester.psm1: line 12807
at <ScriptBlock>, C:\Users\VssAdministrator\Documents\WindowsPowerShell\Modules\Pester\5.0.2\Pester.psm1: line 12958

Expected behaviour

When the tests are using the TestDrive, all tests runs and the TestDrive can be used.

Steps to reproduce the problem

@ChrisLGardner
Copy link
Collaborator

This looks like an issue with Pester itself rather than with the Azure DevOps Extension. Probably worth raising the issue there instead as there's not much I can do about how Azure DevOps handles the registry.

@emmanuelbenitez
Copy link
Author

Thanks for your feedback but the tests works on a local computer. So, the issue is somewhere between the both components ;)

@ChrisLGardner
Copy link
Collaborator

It's certainly an Azure DevOps issue but not one that the extension can solve. It might be worth looking at raising an issue on one of the Azure DevOps repos instead as they might be able to help there.

@plastikfan
Copy link

Is this problem specific to Azure only? Does the TestDrive work on other CI platforms. I have a lot of tests using TestDrive, but I havent hit this road block yet, I'm stuck behind another one at the moment (the [PesterConfiguration] type is not available for some reason, probably not using the lastest version (v5), but how to force the right version who knows)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants