OctopusDeploy / OctopusDSC

| Public | A PowerShell DSC resource for installing Octopus Deploy & Tentacles
Other
1 stars 60 forks source link

Hyper-V tests failing #199

Closed twerthi closed 5 years ago

twerthi commented 5 years ago

I just received a new laptop and have been attempting to get the tests in my fork to work correctly. The first two issues I ran into were relatively easy to resolve, make sure my Pester is up-to-date and install Chocolatey on the Host. However, my latest issue I'm having trouble resolving. Below is part of my vagrant-hyperv.log, what do I need to do to resolve this one?

==> default: Running provisioner: dsc... ==> default: "Running DSC Provisioner with Server_Scenario_01_Install.ps1..." powershell.exe : Join-Path : Cannot find path

At C:\tmp\vagrant-dsc-runner.ps1:12 char:13

Join-Path : Cannot find path 'C:\tmp\vagrant-dsc-93\Tests\Scenarios\Configuration.psd1' because it does not exist. At C:\tmp\vagrant-dsc-runner.ps1:23 char:31

Get-Content : Cannot bind argument to parameter 'Path' because it is null. At C:\tmp\vagrant-dsc-runner.ps1:23 char:30

Server_Scenario_01_Install : The term 'Server_Scenario_01_Install' 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:\tmp\vagrant-dsc-runner.ps1:24 char:1

Start-DscConfiguration : \tmp\vagrant-dsc-93\staging is not a valid directory. At C:\tmp\vagrant-dsc-runner.ps1:27 char:1

del : Cannot find path 'C:\tmp\vagrant-dsc-93\staging' because it does not exist. At C:\tmp\vagrant-dsc-runner.ps1:28 char:1

==> default: Running provisioner: shell... default: Running: inline PowerShell script default: ##teamcity[blockClosed name='Running Scenario Server_Scenario_01_Install'] ==> default: Running provisioner: shell... default: Running: Tests/surface-logs.ps1 as c:\tmp\vagrant-shell.ps1 default: ##teamcity[blockOpened name='Log Files'] default: ##teamcity[blockClosed name='Log Files'] ==> default: Running provisioner: shell... default: Running: inline PowerShell script default: ##teamcity[blockOpened name='Testing Scenario server_scenario_01_install'] default: executing bundle.bat 1.16.1 exec rspec Spec/server_scenario_01_install_spec.rb --format documentation default: An error occurred while loading ./Spec/server_scenario_01_install_spec.rb. default: Failure/Error: default: describe octopus_deploy_environment(ENV['OctopusServerUrl'], ENV['OctopusApiKey'], "Production") do default: it { should exist } default: end default: RuntimeError: default: 'serverUrl' was not provided. Unable to connect to Octopus server to validate configuration. default: # ./vendor/ruby/2.5.0/gems/octopus-serverspec-extensions-0.15.3/lib/octopus_serverspec_extensions/type/octopus_deploy_environment.rb:19:in initialize' default: # ./vendor/ruby/2.5.0/gems/octopus-serverspec-extensions-0.15.3/lib/octopus_serverspec_extensions/type/octopus_deploy_environment.rb:37:innew' default: # ./vendor/ruby/2.5.0/gems/octopus-serverspec-extensions-0.15.3/lib/octopus_serverspec_extensions/type/octopus_deploy_environment.rb:37:in octopus_deploy_environment' default: # ./Spec/server_scenario_01_install_spec.rb:59:in<top (required)>' default: Finished in 0.00023 seconds (files took 0.7853 seconds to load) default: 0 examples, 0 failures, 1 error occurred outside of examples default: ##teamcity[blockClosed name='Testing Scenario server_scenario_01_install'] 'vagrant up' exited with exit code 1 WARNING: Attempted retry, but no retriable failures found Don't forget to run 'vagrant destroy -f' when you have finished

twerthi commented 5 years ago

Ah! I was able to gain access to the VM and found that the folder path has an extra Scenarios folder, instead of

C:\tmp\vagrant-dsc-93\Tests\Scenarios\Server_Scenario_01_Install.ps1

It is

C:\tmp\vagrant-dsc-93\Tests\Scenarios\Scenarios\Server_Scenario_01_Install.ps1

Investigating further...

matt-richardson commented 5 years ago

Version 2.2.4 of Vagrant erm "improved" some stuff, so it now copies stuff around in a different way. We hacked a new version of vagrant-dsc together - https://github.com/OctopusDeploy/vagrant-dsc which handles that.

twerthi commented 5 years ago

@matt-richardson Thank you! That did the trick :)