From b40f9995a2ff03b80dc24fb6aabf253f9e5c726a Mon Sep 17 00:00:00 2001 From: slackersoft Date: Thu, 1 May 2014 13:25:24 -0700 Subject: [PATCH] Use sauce labs to run specs in the same browsers we test jasmine in. - Don't want any weird browser bugs to sneak in [finish #69742564] --- .travis.yml | 41 ++++++++++ Gemfile | 3 +- Gemfile.lock | 76 ++++++++++++------- Rakefile | 1 + .../support/jasmine_selenium_runner.yml | 16 ++++ travis-script.sh | 14 ++++ 6 files changed, 123 insertions(+), 28 deletions(-) create mode 100644 .travis.yml create mode 100644 spec/javascripts/support/jasmine_selenium_runner.yml create mode 100644 travis-script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8c15543 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +script: bash travis-scribe.sh +language: ruby +cache: bundler +rvm: 1.9.3 +env: + global: + - USE_SAUCE=true + - JASMINE_BROWSER="firefox" + - SAUCE_OS="Linux" + - SAUCE_BROWSER_VERSION='' + - secure: PmIDShYXuBaZHlEz0nvcAUinsGUgP6MFlWVS33X9FO3pU1fDLqtV7Zsda25joQDJEmCf9hbfGAsmOHpZdHb54cZnxWjB5Heo/4fr4JcI/0C5wphS6SQTWlBOrLnLN68iYH5Uc+QS7ogFm6+OeiQZbYxl0u0Q2Llu5TwLYDbQHzU= + - secure: Y6Rlr+C2G4/3S0R54LdJx7DYBjZoiOJkg+uD3o6dVsUNnK5cKnJqqMm837nFOEYlbyecNtmwkFfrt28EQ52XJAkjE0RFbcC0u4OpPi7AA8P+IiHEaqpEOg14pH/XkeqcDQrQDzuoP8y2Ijm9GnDFaIW/BALUGLsFo9GnATww8kI= +matrix: + include: + - env: + - JASMINE_BROWSER="safari" + - SAUCE_OS="OS X 10.8" + - SAUCE_BROWSER_VERSION=6 + - env: + - JASMINE_BROWSER="safari" + - SAUCE_OS="OS X 10.6" + - SAUCE_BROWSER_VERSION=5 + - env: + - JASMINE_BROWSER="internet explorer" + - SAUCE_OS="Windows 8" + - SAUCE_BROWSER_VERSION=10 + - env: + - JASMINE_BROWSER="internet explorer" + - SAUCE_OS="Windows 7" + - SAUCE_BROWSER_VERSION=9 + - env: + - JASMINE_BROWSER="internet explorer" + - SAUCE_OS="Windows 7" + - SAUCE_BROWSER_VERSION=8 + - env: + - JASMINE_BROWSER="chrome" + - SAUCE_OS="Linux" + - SAUCE_BROWSER_VERSION='' + - env: + - JASMINE_BROWSER="phantomjs" + - USE_SAUCE=false diff --git a/Gemfile b/Gemfile index 901053a..0f809fd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source "https://rubygems.org" gem 'rake' -gem 'jasmine', "~> 2.0.0.rc5" +gem 'jasmine', "~> 2.0.0" +gem 'jasmine_selenium_runner' diff --git a/Gemfile.lock b/Gemfile.lock index 20e6ff7..58c4fa1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,42 +1,64 @@ GEM remote: https://rubygems.org/ specs: - capybara (2.1.0) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - cliver (0.2.2) - jasmine (2.0.0.rc5) - jasmine-core (~> 2.0.0.rc5) + childprocess (0.3.9) + ffi (~> 1.0, >= 1.0.11) + cmdparse (2.0.5) + ffi (1.9.0) + highline (1.6.20) + jasmine (2.0.0) + jasmine-core (~> 2.0.0) phantomjs rack (>= 1.2.1) rake - jasmine-core (2.0.0.rc5) + jasmine-core (2.0.0) + jasmine_selenium_runner (0.1.1) + jasmine (~> 2.0.0.alpha) + sauce-connect + selenium-webdriver (~> 2.35) + json (1.8.1) mime-types (2.0) - mini_portile (0.5.2) - multi_json (1.8.2) - nokogiri (1.6.0) - mini_portile (~> 0.5.0) - phantomjs (1.8.1.1) - poltergeist - poltergeist (1.4.1) - capybara (~> 2.1.0) - cliver (~> 0.2.1) - multi_json (~> 1.0) - websocket-driver (>= 0.2.0) + multi_json (1.9.0) + net-http-persistent (2.9) + net-ssh (2.7.0) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + parallel (0.9.0) + parallel_tests (0.15.0) + parallel + phantomjs (1.9.7.0) rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) rake (0.9.2.2) - websocket-driver (0.3.0) - xpath (2.0.0) - nokogiri (~> 1.3) + rest-client (1.6.7) + mime-types (>= 1.16) + rubyzip (1.0.0) + sauce (3.2.0) + childprocess (>= 0.1.6) + cmdparse (>= 2.0.2) + highline (>= 1.5.0) + json (>= 1.2.0) + net-http-persistent + net-ssh + net-ssh-gateway + parallel_tests (= 0.15.0) + rest-client + sauce_whisk (~> 0.0.8) + selenium-webdriver (>= 0.1.2) + sauce-connect (3.2.0) + sauce (~> 3.2) + sauce_whisk (0.0.10) + rest-client + selenium-webdriver (2.37.0) + childprocess (>= 0.2.5) + multi_json (~> 1.0) + rubyzip (~> 1.0.0) + websocket (~> 1.0.4) + websocket (1.0.7) PLATFORMS ruby DEPENDENCIES - jasmine (~> 2.0.0.rc5) + jasmine (~> 2.0.0) + jasmine_selenium_runner rake diff --git a/Rakefile b/Rakefile index 44cd943..c17fc9c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require 'jasmine' +require 'jasmine_selenium_runner' load 'jasmine/tasks/jasmine.rake' task :default => "jasmine:ci" diff --git a/spec/javascripts/support/jasmine_selenium_runner.yml b/spec/javascripts/support/jasmine_selenium_runner.yml new file mode 100644 index 0000000..fe36b96 --- /dev/null +++ b/spec/javascripts/support/jasmine_selenium_runner.yml @@ -0,0 +1,16 @@ +--- +use_sauce: <%= ENV['USE_SAUCE'] %> +browser: <%= ENV['JASMINE_BROWSER'] %> +sauce: + name: jasmine-ajax <%= Time.now.to_s %> + username: <%= ENV['SAUCE_USERNAME'] %> + access_key: <%= ENV['SAUCE_ACCESS_KEY'] %> + build: <%= ENV['TRAVIS_BUILD_NUMBER'] || 'Ran locally' %> + tags: + - <%= ENV['TRAVIS_RUBY_VERSION'] || RUBY_VERSION %> + - CI + tunnel_identifier: <%= ENV['TRAVIS_JOB_NUMBER'] ? %Q("#{ENV['TRAVIS_JOB_NUMBER']}") : nil %> + os: <%= ENV['SAUCE_OS'] %> + browser_version: <%= ENV['SAUCE_BROWSER_VERSION'] %> + + diff --git a/travis-script.sh b/travis-script.sh new file mode 100644 index 0000000..414fe93 --- /dev/null +++ b/travis-script.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +if [ $USE_SAUCE == true ] +then + if [ $TRAVIS_SECURE_ENV_VARS == true ] + then + curl -L https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash + else + echo "skipping tests since we can't use sauce" + exit 0 + fi +fi + +bundle exec rake jasmine:ci