Hi folks,
My solution was to switch to busser-rspec, which allows you to provide a Gemfile (and use that to pin back serverspec < 2). I don't see any functional difference in that approach, and also would allow you to pin rspec or install other gems required by rspec/serverspec tests.
Hope this helps,
Martin B. Smith, martin.smith@rackspace.com
From: Rafał Trójniak [rafal@trojniak.net]
Sent: Friday, October 03, 2014 3:56 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Serverspec 2.0 release
Helo,
Thanks, for that notification. I hope it will decrease time for other
people.
I've bumped to this today, and:
- lost 1 hour to figure out what's going one (it was in the middle of a
tests)
- tried 1 hour to freeze version of serverspec in test-kitchen (see
below)
- learned in 20 minutes how to fix incompatibility
Nerveless, this was quite unexpected end of the week. Is there any way
that I can force test-kitchen/busser to use only older version ? Some
way of effectively Gemfile would be really nice. It would allow to
migrate to new version of serverspec with preparations, not by force.
I've tried to google something, even dig into the code. I found that I
can put Gemfile inside serverspec directory (for example
tests/integration/default/serverspec/Gemfile). That almost worked
(older gems were also installed). But still old and new version is
present, ruby uses newer version and test crashes.
I have run tests successfully only by invoking ruby manually, specifying
each library with -I option, but that's it.
Regards.
On Fri, 3 Oct 2014 12:20:18 -0700 (PDT)
bjbq4d@gmail.com wrote:
Most of you probably didn't know serverspec released a 2.0.0
today[1]. You also might not have noticed but this likely breaks your
test kitchen runs with something like this,
/tmp/busser/suites/serverspec/spec_helper.rb:4:in `<top
(required)>': uninitialized constant Serverspec::Helper::Exec
(NameError) ...
From Serverspec,
spec_helper.rb incompatible
spec_helper.rb does not have backward compatibility. So you should
re-generate spec_helper.rb by serverspec-init and check it.
Backend helper and DetectOS helper have been removed
In version 1, you need to include SpecInfra::Helper::backend_type
SpecInfra::Helper::DetectOS to detect the os of target hosts like
this.
require 'serverspec'
include SpecInfra::Helper::Ssh
include SpecInfra::Helper::DetectOS
Test-Kitchen by default will install the latest version of serverspec.
Thankfully upgrading is pretty easy. You can do the whole
serverspec-init if you want but my helper looks like this,
require 'serverspec'
Required by serverspec
set :backend, :exec
[1] - serverspec | RubyGems.org | your community gem host
--
Rafał Trójniak
WEB : http://trojniak.net/
m@il : rafal@trojniak.net
Jid : rafal@trojniak.net
GPG key-ID : 9A9A9E98
ABC8 83DF E717 6B76 CE49
BAFD 4F6F 854F 9A9A 9E98