Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Gem to help incorporating Foreman into integration tests

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 testengineer.gemspec
README.md

TestEngineer

Build Status

TestEngineer is a simple gem which adds some code around foreman for integration testing.

Currently it allows you to bring up an entire stack, based on what is defined in the Foreman Procfile, for the duration of a test case.

TestEngineer also allows you to arbitrarily shut off processes by name during the runtime of a test case.

With Cucumber

There is an Around hook that you can include with require 'testengineer/cucumber'. This will wrap any Scenario tagged with the @testengineer tag.

Imagine a Procfile such as:

web: ruby -r thin app.rb
db: ./script/run-mongodb
cache: memcached

A sample Cucumber feature might look like:

@testengineer
Feature: Log in to My Site
  In order to facilitate meaningful relationships between users
  As a web visitor
  I should be able to log into my account on My Site

Scenario: Log in
  Given an account named "octocat"
  When I log in to My Site
  Then I should be delighted with my fabulous profile

Scenario: Log in when the site is degraded
  Given an account named "octocat"
  And the database is offline
  When I log in to My Site
  Then I should see a nice friendly fail whale.

For each scenario, TestEngineer will bring the entire stack (web, db, cache) up and down. In the second scenario, I would have defined the step for And the database is offline as:

Given /^the database is offline$/ do
  TestEngineer.stop_process('db')
end
Something went wrong with that request. Please try again.