Commit 8b12e8eb by George Song

Use Chrome PPA, update chromedriver, firefox

* No need to download our specific version
* Use officially supplied FF 45
parent fd1b7904
browser_deb_pkgs:
- xvfb
- dbus-x11
- firefox
- gdebi
- libcurl3
- libgconf2-4
- libxss1
- libnss3-1d
- libcurl3
- libxss1
- xdg-utils
- gdebi
- xvfb
# Debian packages we host in S3 to ensure correct browser version
# Both Chrome and FireFox update their apt repos with the latest version,
# which often causes spurious acceptance test failures.
browser_s3_deb_pkgs:
- { name: "firefox-mozilla-build_42.0-0ubuntu1_amd64.deb", url: "https://s3.amazonaws.com/vagrant.testeng.edx.org/firefox-mozilla-build_42.0-0ubuntu1_amd64.deb" }
- { name: "google-chrome-stable_55.0.2883.87-1_amd64.deb", url: "https://s3.amazonaws.com/vagrant.testeng.edx.org/google-chrome-stable_55.0.2883.87-1_amd64.deb" }
# Firefox
firefox_version: version 45.*
# ChromeDriver
chromedriver_version: 2.27
chromedriver_url: "http://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip"
......
# Install browsers required to run the JavaScript
# and acceptance test suite locally without a display
---
- name: lock Firefox version
copy:
dest: /etc/apt/preferences.d/firefox-pinned-version
content: |
Package: firefox
Pin: {{ firefox_version }}
Pin-Priority: 1001
tags:
- install
- install:system-requirements
- name: install system packages
apt: pkg={{','.join(browser_deb_pkgs)}}
state=present update_cache=yes
apt:
pkg: "{{ ','.join(browser_deb_pkgs) }}"
update_cache: yes
tags:
- install
- install:system-requirements
- name: download browser debian packages from S3
get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}"
register: download_deb
with_items: "{{ browser_s3_deb_pkgs }}"
tags:
- install
- install:system-requirements
- name: install browser debian packages
shell: gdebi -nq /tmp/{{ item.name }}
when: download_deb.changed
with_items: "{{ browser_s3_deb_pkgs }}"
tags:
- install
- install:system-requirements
# Because the source location has been deprecated, we need to
# ensure it does not interfere with subsequent apt commands
......@@ -21,55 +42,97 @@
file:
path: /etc/apt/sources.list.d/google-chrome.list
state: absent
tags:
- install
- install:system-requirements
- name: download ChromeDriver
get_url:
url={{ chromedriver_url }}
dest=/var/tmp/chromedriver_{{ chromedriver_version }}.zip
url: "{{ chromedriver_url }}"
dest: /var/tmp/chromedriver_{{ chromedriver_version }}.zip
register: download_chromedriver
tags:
- install
- install:system-requirements
- name: unzip ChromeDriver tarfile
shell: unzip /var/tmp/chromedriver_{{ chromedriver_version }}.zip
chdir=/var/tmp
args:
chdir: /var/tmp
when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: move ChromeDriver binary to /usr/local
shell: mv /var/tmp/chromedriver /usr/local/bin/chromedriver
when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: make ChromeDriver binary executable
file: path=/usr/local/bin/chromedriver mode=0755
file:
path: /usr/local/bin/chromedriver
mode: 0755
when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: verify ChromeDriver location and mode
stat: path=/usr/local/bin/chromedriver
stat:
path: /usr/local/bin/chromedriver
register: chromedriver
tags:
- install
- install:system-requirements
- assert:
that:
- "chromedriver.stat.exists"
- "chromedriver.stat.mode == '0755'"
tags:
- install
- install:system-requirements
- name: download PhantomJS
get_url:
url: "{{ phantomjs_url }}"
dest: "/var/tmp/{{ phantomjs_tarfile }}"
register: download_phantom_js
tags:
- install
- install:system-requirements
- name: unpack the PhantomJS tarfile
shell: "tar -xjf /var/tmp/{{ phantomjs_tarfile }}"
args:
chdir: "/var/tmp"
when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: move PhantomJS binary to /usr/local
shell: mv /var/tmp/{{ phantomjs_version }}/bin/phantomjs /usr/local/bin/phantomjs
when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: verify phantomjs location
stat: path=/usr/local/bin/phantomjs
register: phantomjs
tags:
- install
- install:system-requirements
- assert:
that: "phantomjs.stat.exists"
tags:
- install
- install:system-requirements
- name: create xvfb upstart script for Precise and Trusty (12.04 and 14.04)
template:
......@@ -77,7 +140,7 @@
dest: /etc/init/xvfb.conf
owner: root
group: root
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
when: ansible_distribution_release in ['precise', 'trusty']
tags:
- install
- install:configuration
......@@ -85,7 +148,7 @@
- name: start xvfb upstart script for Precise and Trusty (12.04 and 14.04)
shell: start xvfb
ignore_errors: yes
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
when: ansible_distribution_release in ['precise', 'trusty']
tags:
- install
- install:configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment