Skip to content

Commit

Permalink
Merge 7e49d72 into 3621727
Browse files Browse the repository at this point in the history
  • Loading branch information
samjonester committed Aug 1, 2016
2 parents 3621727 + 7e49d72 commit 3bb8951
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ rerun.txt
*.orig
*~
*.swp
/vendor/
6 changes: 1 addition & 5 deletions .travis.yml
Expand Up @@ -2,10 +2,6 @@ language: java
jdk:
- oraclejdk7
- oraclejdk8
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
install: travis_retry bundle install
script: bundle exec rake cucumber
script: ./run-headless-tests
after_success:
- mvn clean test jacoco:report coveralls:report
93 changes: 93 additions & 0 deletions Dockerfile
@@ -0,0 +1,93 @@
FROM ubuntu:xenial
RUN apt-get update

###
# Java
###

# Install Java 7
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get update
RUN apt-get install -y oracle-java7-installer
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/cache/oracle-jdk7-installer

ENV JAVA_HOME /usr/lib/jvm/java-7-oracle

# Install Maven
RUN add-apt-repository -y universe
RUN apt-get update
RUN apt-get install -y maven
RUN mkdir -p /root/.m2



###
# Ruby
###
RUN apt-get install -y build-essential patch ruby-full
RUN gem install bundler
ENV BUNDLE_PATH /bundler



###
# Phantom JS
###

# Libraries to install phantomjs
RUN apt-get install -y wget libfontconfig1 libfreetype6


# Set up Environment variables for PhantomJS
ENV PHANTOMJS_VERSION 1.9.8
ENV PHANTOMJS_DIR /phantomjs

# Download and untar PhantomJS
RUN wget -q --continue -P $PHANTOMJS_DIR "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2"
RUN tar -xaf $PHANTOMJS_DIR/phantomjs* --strip-components=1 --directory "$PHANTOMJS_DIR"

# Set the PATH to include PhantomJS
ENV PATH $PHANTOMJS_DIR/bin:$PATH



###
# Firefox
###

# We need wget to download the custom version of Firefox, xvfb to have a virtual screen and Firefox so all necessary libraries are installed.
RUN apt-get install -y build-essential wget firefox


# Setting the Firefox version and installation directory through environment variables.
ENV FIREFOX_VERSION 38.0
ENV FIREFOX_DIR $HOME/firefox
ENV FIREFOX_FILENAME $FIREFOX_DIR/firefox.tar.bz2

# Create the Firefox directory, download the custom Firefox version from Mozilla and untar it.
RUN mkdir $FIREFOX_DIR
RUN wget -q --continue --output-document $FIREFOX_FILENAME "https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2"
RUN tar -xaf "$FIREFOX_FILENAME" --strip-components=1 --directory "$FIREFOX_DIR"

# Setting the PATH so our customer Firefox version will be used first
ENV PATH $FIREFOX_DIR:$PATH



###
# Xvfb for headless browser testing
###
RUN apt-get install -y xvfb dbus-x11
# Script using container should first run the following command:
# export DISPLAY=:99 && Xvfb :99 &


###
# Add our code
###

ADD . /code
WORKDIR /code
4 changes: 3 additions & 1 deletion Gemfile.lock
Expand Up @@ -33,7 +33,6 @@ GEM
domain_name (~> 0.5)
json (1.8.3)
mime-types (2.99)
mime-types-data (3.2015.1120)
mini_portile (0.6.0)
multi_json (1.11.2)
multi_test (0.1.2)
Expand Down Expand Up @@ -89,3 +88,6 @@ DEPENDENCIES
relish
rspec
selenium-webdriver (~> 2.48.1)

BUNDLED WITH
1.12.5
12 changes: 12 additions & 0 deletions docker-compose.yaml
@@ -0,0 +1,12 @@
test-suite:
build: .
volumes:
- .:/code
volumes_from:
- box

box:
image: busybox
volumes:
- /bundler
- /root/.m2
6 changes: 6 additions & 0 deletions run-headless-tests
@@ -0,0 +1,6 @@
#!/bin/bash

export DISPLAY=:99
Xvfb :99 &
bundle install
rake cucumber
3 changes: 3 additions & 0 deletions test-docker
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose run test-suite ./run-headless-tests

0 comments on commit 3bb8951

Please sign in to comment.