Serverspec 2.0 release


#1

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


#2

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


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


#3

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


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


#4

You can use a gemfile with busser-serverspec too I think.

–Noah

On Oct 3, 2014, at 2:57 PM, Martin Smith martin.smith@RACKSPACE.COM wrote:

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


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


#5

@Noah - Well… I can supply additional Gemfile (tried that that before).

When Gemfile is in serverspec directory, busser run first time
installs Serverspec 2.0. After that there was second round of bundle
running with Gemfile in use - older version is also installed.

When tests are invoked there are two Serverspec versions installed, and
Serverspec 2.0 is used - test crashes.

Maybe I did something wrong ?

@Martin - Thanks for the information. I’ll try that when i’ll be at
work next week. Can you supply any example how you are doing that ?

Regards.

On Fri, 3 Oct 2014 20:01:42 -0700 Noah Kantrowitz noah@coderanger.net
wrote:

You can use a gemfile with busser-serverspec too I think.

–Noah

On Oct 3, 2014, at 2:57 PM, Martin Smith martin.smith@RACKSPACE.COM
wrote:

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


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


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


#6

As there doesn’t appear to be a resolution to this problem (and I just hit
it today), I just wanted to know if anyone have filed a bug on this yet.
Not being able to version lock bussers means backward incompatible versions
will occasionally break CI and that definitely screams “bug” to me.

On Sat, Oct 4, 2014 at 3:43 AM, Rafał Trójniak rafal@trojniak.net wrote:

@Noah - Well… I can supply additional Gemfile (tried that that before).

When Gemfile is in serverspec directory, busser run first time
installs Serverspec 2.0. After that there was second round of bundle
running with Gemfile in use - older version is also installed.

When tests are invoked there are two Serverspec versions installed, and
Serverspec 2.0 is used - test crashes.

Maybe I did something wrong ?

@Martin - Thanks for the information. I’ll try that when i’ll be at
work next week. Can you supply any example how you are doing that ?

Regards.

On Fri, 3 Oct 2014 20:01:42 -0700 Noah Kantrowitz noah@coderanger.net
wrote:

You can use a gemfile with busser-serverspec too I think.

–Noah

On Oct 3, 2014, at 2:57 PM, Martin Smith martin.smith@RACKSPACE.COM
wrote:

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] - http://rubygems.org/gems/serverspec/versions/2.0.0


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


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

–tucker


#7

Hi all,

They released a third new version of the serverspec gem last night, and switched to using a different json gem for a dependency. This solved at least one problem from yesterday, which is the original json dependency required build tools that weren’t always installed.

Also, the maintainers of busser-serverspec committed a feature in the last 8 hours or so that allow a version of serverspec to be configured a little easier (@Rafal, see the README.md on busser-serverspec for examples):

https://github.com/test-kitchen/busser-serverspec/issues/16

There’s also this PR (and see issue #515), which would allow us to specify gem versions in test-kitchen directly, which would be amazing:

https://github.com/test-kitchen/test-kitchen/pull/518

I think that second PR is what you’re looking for, Tucker.

Cheers,

  • Martin

From: Tucker [junk@gmail.com]
Sent: Wednesday, October 15, 2014 1:05 PM
To: chef@lists.opscode.com
Cc: Noah Kantrowitz
Subject: [chef] Re: Re: RE: Re: Serverspec 2.0 release

As there doesn’t appear to be a resolution to this problem (and I just hit it today), I just wanted to know if anyone have filed a bug on this yet. Not being able to version lock bussers means backward incompatible versions will occasionally break CI and that definitely screams “bug” to me.

On Sat, Oct 4, 2014 at 3:43 AM, Rafał Trójniak <rafal@trojniak.netmailto:rafal@trojniak.net> wrote:
@Noah - Well… I can supply additional Gemfile (tried that that before).

When Gemfile is in serverspec directory, busser run first time
installs Serverspec 2.0. After that there was second round of bundle
running with Gemfile in use - older version is also installed.

When tests are invoked there are two Serverspec versions installed, and
Serverspec 2.0 is used - test crashes.

Maybe I did something wrong ?

@Martin - Thanks for the information. I’ll try that when i’ll be at
work next week. Can you supply any example how you are doing that ?

Regards.

On Fri, 3 Oct 2014 20:01:42 -0700 Noah Kantrowitz <noah@coderanger.netmailto:noah@coderanger.net>
wrote:

You can use a gemfile with busser-serverspec too I think.

–Noah

On Oct 3, 2014, at 2:57 PM, Martin Smith <martin.smith@RACKSPACE.COMmailto:martin.smith@RACKSPACE.COM>
wrote:

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.commailto:martin.smith@rackspace.com


From: Rafał Trójniak [rafal@trojniak.netmailto:rafal@trojniak.net]
Sent: Friday, October 03, 2014 3:56 PM
To: chef@lists.opscode.commailto: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.commailto: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] - http://rubygems.org/gems/serverspec/versions/2.0.0


Rafał Trójniak
WEB : http://trojniak.net/
m@il : rafal@trojniak.netmailto:rafal@trojniak.net
Jid : rafal@trojniak.netmailto:rafal@trojniak.net
GPG key-ID : 9A9A9E98
ABC8 83DF E717 6B76 CE49
BAFD 4F6F 854F 9A9A 9E98


Rafał Trójniak
WEB : http://trojniak.net/
m@il : rafal@trojniak.netmailto:rafal@trojniak.net
Jid : rafal@trojniak.netmailto:rafal@trojniak.net
GPG key-ID : 9A9A9E98
ABC8 83DF E717 6B76 CE49
BAFD 4F6F 854F 9A9A 9E98

–tucker