-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support for Test Kitchen #37
Comments
@englishm Sorry for very late reply. Infrataster::Server.define(
:web,
'127.0.0.1',
) |
👍 |
@englishm I tested @ryotarai suggestion and it works just fine. Add a source 'https://rubygems.org'
gem 'infrataster' Add to your require 'serverspec'
require 'infrataster/rspec'
set :backend, :exec
Infrataster::Server.define(:app, '127.0.0.1') Start writing your tests along with your serverspecs. Example require 'spec_helper'
(9000..9002).each do |port|
describe port(port) do
it { should be_listening.on('127.0.0.1').with('tcp') }
end
describe server(:app) do
describe http("http://127.0.0.1:#{port}/healthcheck") do
it "responds content including 'WORKING'" do
expect(response.body).to include('WORKING')
end
end
end
end Let me know if you have any issues. It's working fine for me. |
@estahn but this would again test from the inside, not outside-in, right? |
FYI - @LordCope is taking a similar approach with https://github.com/Atalanta/leibniz/ It's also outside-in, acceptance level infrastructure testing, but cucumber/gherkin. |
@estahn, thanks for providing that info about what worked for you. Can you provide a little color around why the spec_helper.rb + Gemfile in the serverspec directory should work? I've tried to reproduce what you have but I'm getting this: /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.3.0/lib:/tmp/verifier/gems/gems/rspec-core-3.3.2/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspecd such file -- infrataster (LoadError) which to me seems to indicate that TK isn't finding the infrataster gem. On a side note, I had to modify the 'require' in spec_helper.rb to be just "require 'infrataster'" , no "/rspec" because Ruby was complaining about the ability to load that file. |
Just to loop back on this for anyone else who happens along later... The busser-servespec code allows for a Gemfile to be dropped in the serverspec directory and it will run a 'bundle install' automagically. |
I'm having issues with the suggestions here. Atleast on CentOS:
|
It would be really great if we could integrate infrataster with our existing test-kitchen-based tests.
We often use Test Kitchen with the kitchen-digitalocean driver so that we can launch tests in the cloud from a VM. Being able to run infrataster against that same instance would allow us to use infrataster as part of our existing CI system. Currently, I am only able to run infrataster tests locally where I have control over the IP address assigned to a VM (e.g. w/ Vagrant).
Thoughts?
The text was updated successfully, but these errors were encountered: