Skip to content

Commit

Permalink
Integrate with Travis-CI
Browse files Browse the repository at this point in the history
Now we have removed the dependency on an external site for our example features, we can integrate Quke with a CI service.

This change sets up the project to work with Travis CI so future changes will automatically be tested.
  • Loading branch information
Cruikshanks committed Jun 29, 2016
1 parent 991b3fe commit 0ea80d5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: ruby
rvm:
- 2.3.1

# Travis CI clones repositories to a depth of 50 commits, which is only really
# useful if you are performing git operations.
# https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth
git:
depth: 3

# enable Bundler caching
# https://docs.travis-ci.com/user/languages/ruby#Caching-Bundler
cache: bundler

# Exclude non-essential gem dependencies
# https://docs.travis-ci.com/user/languages/ruby#Speeding-up-your-build-by-excluding-non-essential-dependencies
bundler_args: --without development

script:
- bundle exec thin -c quke_demo_app/ -p 4567 -d --tag quke start
- bundle exec cucumber -p quke
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Quke
# Quke <img src="/quke_demo_app/public/assets/images/quke.png" alt="Git flow" style="width: 50px;"/>

[![Build Status](https://travis-ci.org/EnvironmentAgency/quke.svg?branch=master)](https://travis-ci.org/EnvironmentAgency/quke)

A template repo for building [Cucumber](https://cucumber.io/) feature tests that can be run against a web site. Unlike normal setups the feature tests do not need to be included with the source code for the site to be tested. Instead this template project includes the ability to run them standalone.

Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
# automatically in the event of an error when using the selenium driver.
# Not setting this leads to Capybara saving the file to the root of the project
# which can get in the way when trying to work with Quke in your projects.
Capybara.save_and_open_page_path = 'tmp/'
Capybara.save_path = 'tmp/'

# We capture the value as a global env var so if necessary length of time
# between page interactions can be referenced elsewhere, for example in any
Expand Down
2 changes: 2 additions & 0 deletions quke_demo_app/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# We don't want the browser caching the assets so we specify this
set :static_cache_control, [:public, max_age: 0]

# It's not critical for this app, but best practise is to secure your session
# with a secret key, and this also stops Sinatra complaining!
set :session_secret, SECRET ||= 'super secret'.freeze
end

Expand Down
9 changes: 9 additions & 0 deletions quke_demo_app/config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The config.ru file allows us to use any Rack handler, which in our case is
# [Thin](https://github.com/macournoyer/thin) to start the app, rather than
# relying on Sinatra magic.
# This now means we can start the app using thin directly with direct access
# to all the args you can normally pass into it. We mainly needed this to allow
# us to start the app using thin on Travis-CI, so we could then run the tests
# against it.
require './app'
run Sinatra::Application

0 comments on commit 0ea80d5

Please sign in to comment.