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

Travis build fails on rspec, what now? #54

Closed
bheuvel opened this issue Sep 23, 2015 · 3 comments · Fixed by #61
Closed

Travis build fails on rspec, what now? #54

bheuvel opened this issue Sep 23, 2015 · 3 comments · Fixed by #61

Comments

@bheuvel
Copy link
Contributor

bheuvel commented Sep 23, 2015

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:

  1. Drop rspec tests for Travis
  2. 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.

@tas50 @jaym any thoughts?

PS Too bad these rspec tests can't run, as for example some are broken since commit c369803

@bheuvel
Copy link
Contributor Author

bheuvel commented Sep 24, 2015

Fixed the rspec tests with PR #55

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?

@jaym
Copy link
Contributor

jaym commented Sep 24, 2015

I think we should run in appveyor rather than travis

@Annih
Copy link
Contributor

Annih commented Nov 28, 2015

Hello,

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?

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

Successfully merging a pull request may close this issue.

3 participants