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: browser_deb_pkgs:
- xvfb
- dbus-x11 - dbus-x11
- firefox
- gdebi
- libcurl3
- libgconf2-4 - libgconf2-4
- libxss1
- libnss3-1d - libnss3-1d
- libcurl3 - libxss1
- xdg-utils - xdg-utils
- gdebi - xvfb
# Debian packages we host in S3 to ensure correct browser version # Debian packages we host in S3 to ensure correct browser version
# Both Chrome and FireFox update their apt repos with the latest version, # Both Chrome and FireFox update their apt repos with the latest version,
# which often causes spurious acceptance test failures. # which often causes spurious acceptance test failures.
browser_s3_deb_pkgs: 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" } - { 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
chromedriver_version: 2.27 chromedriver_version: 2.27
chromedriver_url: "http://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip" chromedriver_url: "http://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip"
......
# Install browsers required to run the JavaScript # Install browsers required to run the JavaScript
# and acceptance test suite locally without a display # 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 - name: install system packages
apt: pkg={{','.join(browser_deb_pkgs)}} apt:
state=present update_cache=yes pkg: "{{ ','.join(browser_deb_pkgs) }}"
update_cache: yes
tags:
- install
- install:system-requirements
- name: download browser debian packages from S3 - name: download browser debian packages from S3
get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}" get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}"
register: download_deb register: download_deb
with_items: "{{ browser_s3_deb_pkgs }}" with_items: "{{ browser_s3_deb_pkgs }}"
tags:
- install
- install:system-requirements
- name: install browser debian packages - name: install browser debian packages
shell: gdebi -nq /tmp/{{ item.name }} shell: gdebi -nq /tmp/{{ item.name }}
when: download_deb.changed when: download_deb.changed
with_items: "{{ browser_s3_deb_pkgs }}" with_items: "{{ browser_s3_deb_pkgs }}"
tags:
- install
- install:system-requirements
# Because the source location has been deprecated, we need to # Because the source location has been deprecated, we need to
# ensure it does not interfere with subsequent apt commands # ensure it does not interfere with subsequent apt commands
...@@ -21,55 +42,97 @@ ...@@ -21,55 +42,97 @@
file: file:
path: /etc/apt/sources.list.d/google-chrome.list path: /etc/apt/sources.list.d/google-chrome.list
state: absent state: absent
tags:
- install
- install:system-requirements
- name: download ChromeDriver - name: download ChromeDriver
get_url: get_url:
url={{ chromedriver_url }} url: "{{ chromedriver_url }}"
dest=/var/tmp/chromedriver_{{ chromedriver_version }}.zip dest: /var/tmp/chromedriver_{{ chromedriver_version }}.zip
register: download_chromedriver register: download_chromedriver
tags:
- install
- install:system-requirements
- name: unzip ChromeDriver tarfile - name: unzip ChromeDriver tarfile
shell: unzip /var/tmp/chromedriver_{{ chromedriver_version }}.zip shell: unzip /var/tmp/chromedriver_{{ chromedriver_version }}.zip
chdir=/var/tmp args:
chdir: /var/tmp
when: download_chromedriver.changed when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: move ChromeDriver binary to /usr/local - name: move ChromeDriver binary to /usr/local
shell: mv /var/tmp/chromedriver /usr/local/bin/chromedriver shell: mv /var/tmp/chromedriver /usr/local/bin/chromedriver
when: download_chromedriver.changed when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: make ChromeDriver binary executable - 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 when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: verify ChromeDriver location and mode - name: verify ChromeDriver location and mode
stat: path=/usr/local/bin/chromedriver stat:
path: /usr/local/bin/chromedriver
register: chromedriver register: chromedriver
tags:
- install
- install:system-requirements
- assert: - assert:
that: that:
- "chromedriver.stat.exists" - "chromedriver.stat.exists"
- "chromedriver.stat.mode == '0755'" - "chromedriver.stat.mode == '0755'"
tags:
- install
- install:system-requirements
- name: download PhantomJS - name: download PhantomJS
get_url: get_url:
url: "{{ phantomjs_url }}" url: "{{ phantomjs_url }}"
dest: "/var/tmp/{{ phantomjs_tarfile }}" dest: "/var/tmp/{{ phantomjs_tarfile }}"
register: download_phantom_js register: download_phantom_js
tags:
- install
- install:system-requirements
- name: unpack the PhantomJS tarfile - name: unpack the PhantomJS tarfile
shell: "tar -xjf /var/tmp/{{ phantomjs_tarfile }}" shell: "tar -xjf /var/tmp/{{ phantomjs_tarfile }}"
args: args:
chdir: "/var/tmp" chdir: "/var/tmp"
when: download_phantom_js.changed when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: move PhantomJS binary to /usr/local - name: move PhantomJS binary to /usr/local
shell: mv /var/tmp/{{ phantomjs_version }}/bin/phantomjs /usr/local/bin/phantomjs shell: mv /var/tmp/{{ phantomjs_version }}/bin/phantomjs /usr/local/bin/phantomjs
when: download_phantom_js.changed when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: verify phantomjs location - name: verify phantomjs location
stat: path=/usr/local/bin/phantomjs stat: path=/usr/local/bin/phantomjs
register: phantomjs register: phantomjs
tags:
- install
- install:system-requirements
- assert: - assert:
that: "phantomjs.stat.exists" that: "phantomjs.stat.exists"
tags:
- install
- install:system-requirements
- name: create xvfb upstart script for Precise and Trusty (12.04 and 14.04) - name: create xvfb upstart script for Precise and Trusty (12.04 and 14.04)
template: template:
...@@ -77,7 +140,7 @@ ...@@ -77,7 +140,7 @@
dest: /etc/init/xvfb.conf dest: /etc/init/xvfb.conf
owner: root owner: root
group: root group: root
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty' when: ansible_distribution_release in ['precise', 'trusty']
tags: tags:
- install - install
- install:configuration - install:configuration
...@@ -85,7 +148,7 @@ ...@@ -85,7 +148,7 @@
- name: start xvfb upstart script for Precise and Trusty (12.04 and 14.04) - name: start xvfb upstart script for Precise and Trusty (12.04 and 14.04)
shell: start xvfb shell: start xvfb
ignore_errors: yes ignore_errors: yes
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty' when: ansible_distribution_release in ['precise', 'trusty']
tags: tags:
- install - install
- install:configuration - 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