Skip to content
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

Installing required dependencies for Chrome Driver #5751

Merged
merged 3 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
sudo: required

language: generic

services:
- docker

git:
depth: false

env:
- COMPOSE_FILE=./containers/docker-compose-testing.yml
global:
- COMPOSE_FILE=./containers/docker-compose-testing.yml
matrix:
- TASK="rake test:all"
- TASK="rails test:system"

before_install:
- echo -e "repo_token:\n $COVERALLS_REPO_TOKEN" >> ./.coveralls.yml
Expand All @@ -23,23 +29,20 @@ install:
- docker-compose build
- docker-compose up -d
- docker-compose exec web sleep 5
- docker-compose logs
- netstat -ltpn
- docker-compose exec web bash -c "rake db:setup"
- docker-compose exec web bash -c "rake db:migrate"
- docker-compose exec web bash -c "rake assets:precompile"
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then gem install danger danger-junit; fi'

script:
- docker-compose exec web bash -c "apt install -y phantomjs"
- docker-compose exec web bash -c "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
- docker-compose exec web bash -c "dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install"
- docker-compose exec web bash -c "wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip" # https://sites.google.com/a/chromium.org/chromedriver/
- docker-compose exec web bash -c "unzip chromedriver_linux64.zip"
- docker-compose exec web bash -c "mv chromedriver /usr/local/bin/chromedriver"
- docker-compose exec web bash -c "chmod +x /usr/local/bin/chromedriver"
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true rake test:all"
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true rails test:system test"
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then danger --verbose; fi'
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true $TASK"
- |
if [ $TASK != "rake test:all" ]; then
echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml;
tail -n +2 -q ./test/reports/TEST*.xml >> output.xml;
fi
- |
if [ $TRAVIS_PULL_REQUEST != "false"; then
danger --verbose;
fi
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,24 @@ RUN apt-key add /tmp/nodesource.gpg.key && apt-get update -qq \
apt-transport-https libfreeimage3 \
&& npm install -g yarn

# Install bundle of gems

RUN apt-get install -y fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
libatspi2.0-0 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxss1 \
libxtst6 xdg-utils phantomjs lsb-release
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
dpkg -i google-chrome-stable_current_amd64.deb && \
apt-get -fy install && \
wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip && \
mv chromedriver /usr/local/bin/chromedriver && \
chmod +x /usr/local/bin/chromedriver

WORKDIR /tmp
ADD Gemfile /tmp/Gemfile
ADD Gemfile.lock /tmp/Gemfile.lock
RUN bundle install --jobs=4

WORKDIR /app

COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
COPY start.sh /app/start.sh
Expand Down
2 changes: 1 addition & 1 deletion test/system/dashboard_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "application_system_test_case"

class DashboardTest < ApplicationSystemTestCase
Capybara.default_max_wait_time = 5
Capybara.default_max_wait_time = 60

test 'viewing the dashboard' do
visit '/'
Expand Down