You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried looking into this and it seems to crash on (e.g.) require 'chef/win32/version', really on the include itself.
When looking at this discussion, chefspec/chefspec#405, certain OS specific recipes can't be tested on other OS'ses, such as recipe for Windows on Travis/Linux.
This at least seems to be true for all recipe tests requiring (require 'chef/win32/version').
When fixing this there seems to be two roads to start on:
Drop rspec tests for Travis
Adjust most tests to run on a tag (e.g. describe 'powershell::powershell2', :windows_only do) and pass --tag unix_only to Travis/rspec, effectively NOT running most tests.
The latter needs some more (or better 😉) work as my experience is that the require 'chef/win32/version' needs to by copied/duplicated down to (every) before do block, or else it will still be evaluated/included and causes a crash.
Am willing to fix this, but need some advise on this.
Perhaps the way to get these into Travis (not Windows dependent) is to wrap some Windows (gem) specifc code into small classes/module so that that specicf part can be mocked in rspec?
I personally chose to not use Win32/Version which relies on win32 API calls, but instead rely on ohai - which are computed via win32 api calls.
I created a small library - currently in ms_dotnet cookbook - allowing me to easily use windows ohai.
This way, you can easily mock ohais in rspec! What do you think?
As of commit 980227d the Travis build is failing.
Tried looking into this and it seems to crash on (e.g.)
require 'chef/win32/version'
, really on the include itself.When looking at this discussion, chefspec/chefspec#405, certain OS specific recipes can't be tested on other OS'ses, such as recipe for Windows on Travis/Linux.
This at least seems to be true for all recipe tests requiring (
require 'chef/win32/version'
).When fixing this there seems to be two roads to start on:
describe 'powershell::powershell2', :windows_only do
) and pass--tag unix_only
to Travis/rspec, effectively NOT running most tests.The latter needs some more (or better 😉) work as my experience is that the
require 'chef/win32/version'
needs to by copied/duplicated down to (every)before do
block, or else it will still be evaluated/included and causes a crash.Am willing to fix this, but need some advise on this.
@tas50 @jaym any thoughts?
PS Too bad these rspec tests can't run, as for example some are broken since commit c369803
The text was updated successfully, but these errors were encountered: