OLD | NEW |
1 set -e | 1 set -e |
2 | 2 |
3 export BUILD_HOME=$HOME/build | |
4 export WPT_HOME=$BUILD_HOME/w3c/web-platform-tests | |
5 | |
6 hosts_fixup() { | 3 hosts_fixup() { |
| 4 echo "travis_fold:start:hosts_fixup" |
7 echo "== /etc/hosts ==" | 5 echo "== /etc/hosts ==" |
8 cat /etc/hosts | 6 cat /etc/hosts |
9 echo "----------------" | 7 echo "----------------" |
10 sudo sed -i 's/^::1\s*localhost/::1/' /etc/hosts | 8 sudo sed -i 's/^::1\s*localhost/::1/' /etc/hosts |
11 sudo sh -c 'echo " | 9 sudo sh -c 'echo " |
12 127.0.0.1 web-platform.test | 10 127.0.0.1 web-platform.test |
13 127.0.0.1 www.web-platform.test | 11 127.0.0.1 www.web-platform.test |
14 127.0.0.1 www1.web-platform.test | 12 127.0.0.1 www1.web-platform.test |
15 127.0.0.1 www2.web-platform.test | 13 127.0.0.1 www2.web-platform.test |
16 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test | 14 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test |
17 127.0.0.1 xn--lve-6lad.web-platform.test | 15 127.0.0.1 xn--lve-6lad.web-platform.test |
18 " >> /etc/hosts' | 16 " >> /etc/hosts' |
19 echo "== /etc/hosts ==" | 17 echo "== /etc/hosts ==" |
20 cat /etc/hosts | 18 cat /etc/hosts |
21 echo "----------------" | 19 echo "----------------" |
| 20 echo "travis_fold:end:hosts_fixup" |
22 } | 21 } |
23 | 22 |
24 fetch_master() { | |
25 cd $WPT_HOME | |
26 git fetch https://github.com/w3c/web-platform-tests.git master:master | |
27 } | |
28 | |
29 build_manifest() { | |
30 cd $WPT_HOME | |
31 python manifest | |
32 } | |
33 | |
34 install_wptrunner() { | |
35 cd $BUILD_HOME | |
36 if [ ! -d w3c/wptrunner ]; then | |
37 git clone --depth 1 https://github.com/w3c/wptrunner.git w3c/wptrunner | |
38 cd w3c/wptrunner | |
39 else | |
40 cd w3c/wptrunner | |
41 git fetch https://github.com/w3c/wptrunner.git | |
42 fi | |
43 git reset --hard origin/master | |
44 git submodule update --init --recursive | |
45 pip install . | |
46 } | |
47 | |
48 install_firefox() { | |
49 cd $BUILD_HOME | |
50 pip install -r w3c/wptrunner/requirements_firefox.txt | |
51 wget https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
firefox-52.0a1.en-US.linux-x86_64.tar.bz2 | |
52 tar -xf firefox-52.0a1.en-US.linux-x86_64.tar.bz2 | |
53 | |
54 if [ ! -d profiles ]; then | |
55 mkdir profiles | |
56 fi | |
57 cd profiles | |
58 wget https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/profiles/pr
efs_general.js | |
59 } | |
60 | |
61 install_geckodriver() { | |
62 cd $BUILD_HOME | |
63 local release_url | |
64 local tmpfile | |
65 local release_data | |
66 # Stupid hacky way of getting the release URL from the GitHub API | |
67 tmpfile=$(mktemp) | |
68 echo 'import json, sys | |
69 data = json.load(sys.stdin) | |
70 print (item["browser_download_url"] for item in data["assets"] | |
71 if "linux64" in item["browser_download_url"]).next()' > "$tmpfile" | |
72 release_data=$(curl -s https://api.github.com/repos/mozilla/geckodriver/rele
ases/latest?access_token=$GH_TOKEN) | |
73 echo $RELEASE_DATA | |
74 release_url=$(echo $release_data | python $tmpfile) | |
75 rm "$tmpfile" | |
76 wget "$release_url" | |
77 tar xf geckodriver*.tar.gz | |
78 } | |
79 | |
80 install_chrome() { | |
81 cd $BUILD_HOME | |
82 local latest | |
83 pip install -r w3c/wptrunner/requirements_chrome.txt | |
84 latest=$(curl https://www.googleapis.com/download/storage/v1/b/chromium-brow
ser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media) | |
85 curl "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snap
shots/o/Linux_x64%2F$latest%2Fchrome-linux.zip?alt=media" > chrome-linux64.zip | |
86 unzip -q chrome-linux64.zip | |
87 } | |
88 | |
89 install_chromedriver() { | |
90 cd $BUILD_HOME | |
91 local latest | |
92 latest=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE) | |
93 wget "http://chromedriver.storage.googleapis.com/$latest/chromedriver_linux6
4.zip" | |
94 unzip -q chromedriver_linux64.zip | |
95 } | |
96 | 23 |
97 test_stability() { | 24 test_stability() { |
98 cd $WPT_HOME | 25 python check_stability.py $PRODUCT |
99 python check_stability.py --root $BUILD_HOME --comment-pr ${TRAVIS_PULL_REQU
EST} --gh-token ${GH_TOKEN} $PRODUCT | |
100 } | 26 } |
101 | 27 |
102 main() { | 28 main() { |
103 fetch_master | 29 hosts_fixup |
104 build_manifest | |
105 install_wptrunner | |
106 case "$PRODUCT" in | |
107 firefox) | |
108 install_firefox | |
109 install_geckodriver | |
110 ;; | |
111 chrome) | |
112 hosts_fixup | |
113 install_chrome | |
114 install_chromedriver | |
115 ;; | |
116 *) | |
117 echo "Unrecognised product $PRODUCT" | |
118 exit 1 | |
119 esac | |
120 test_stability | 30 test_stability |
121 } | 31 } |
122 | 32 |
123 main | 33 main |
OLD | NEW |