Skip to content

Commit 77a4a0e

Browse files
committed
Add Travis support
1 parent d6ae125 commit 77a4a0e

File tree

4 files changed

+102
-2
lines changed

4 files changed

+102
-2
lines changed

.travis-setup.sh

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#! /bin/bash
2+
3+
set -x
4+
set -e
5+
6+
# Make sure /dev/shm has correct permissions.
7+
ls -l /dev/shm
8+
sudo chmod 1777 /dev/shm
9+
ls -l /dev/shm
10+
11+
uname -a
12+
cat /etc/lsb-release
13+
14+
npm install
15+
npm install -g grunt-cli
16+
17+
sudo apt-get update --fix-missing
18+
19+
# Install python-imaging from the environment rather then build it.
20+
# If the below fails, pip will build it via the requirements.txt
21+
# sudo apt-get install python-imaging
22+
# VIRTUAL_ENV_site_packages=$(echo $VIRTUAL_ENV/lib/*/site-packages)
23+
# VIRTUAL_ENV_python_version=$(echo $VIRTUAL_ENV_site_packages | sed -e's@.*/\(.*\)/site-packages@\1@')
24+
# ln -s /usr/lib/$VIRTUAL_ENV_python_version/dist-packages/PIL.pth $VIRTUAL_ENV_site_packages/PIL.pth
25+
# ln -s /usr/lib/$VIRTUAL_ENV_python_version/dist-packages/PIL $VIRTUAL_ENV_site_packages/PIL
26+
27+
export VERSION=$(echo $BROWSER | sed -e's/[^-]*-//')
28+
export BROWSER=$(echo $BROWSER | sed -e's/-.*//')
29+
30+
echo BROWSER=$BROWSER
31+
echo VERSION=$VERSION
32+
33+
sudo ln -sf $(which true) $(which xdg-desktop-menu)
34+
35+
case $BROWSER in
36+
Android)
37+
sudo apt-get install -qq --force-yes \
38+
libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 \
39+
libstdc++6:i386 lib32z1 libreadline6-dev:i386 \
40+
libncurses5-dev:i386
41+
bash tools/android/setup.sh
42+
;;
43+
44+
Chrome)
45+
echo "Getting $VERSION of $BROWSER"
46+
export CHROME=google-chrome-${VERSION}_current_amd64.deb
47+
wget https://dl.google.com/linux/direct/$CHROME
48+
sudo dpkg --install $CHROME || sudo apt-get -f install
49+
which google-chrome
50+
ls -l `which google-chrome`
51+
52+
if [ -f /opt/google/chrome/chrome-sandbox ]; then
53+
export CHROME_SANDBOX=/opt/google/chrome/chrome-sandbox
54+
else
55+
export CHROME_SANDBOX=$(ls /opt/google/chrome*/chrome-sandbox)
56+
fi
57+
58+
# Download a custom chrome-sandbox which works inside OpenVC containers (used on travis).
59+
sudo rm -f $CHROME_SANDBOX
60+
sudo wget https://googledrive.com/host/0B5VlNZ_Rvdw6NTJoZDBSVy1ZdkE -O $CHROME_SANDBOX
61+
sudo chown root:root $CHROME_SANDBOX; sudo chmod 4755 $CHROME_SANDBOX
62+
sudo md5sum $CHROME_SANDBOX
63+
64+
google-chrome --version
65+
;;
66+
67+
Firefox)
68+
sudo rm -f /usr/local/bin/firefox
69+
case $VERSION in
70+
beta)
71+
yes "\n" | sudo add-apt-repository -y ppa:mozillateam/firefox-next
72+
;;
73+
aurora)
74+
yes "\n" | sudo add-apt-repository -y ppa:ubuntu-mozilla-daily/firefox-aurora
75+
;;
76+
esac
77+
sudo apt-get update --fix-missing
78+
sudo apt-get install firefox
79+
which firefox
80+
ls -l `which firefox`
81+
firefox --version
82+
;;
83+
esac
84+
85+
# R=tools/python/requirements.txt
86+
# pip install -r $R --use-mirrors || pip install -r $R

.travis.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
3+
node_js:
4+
- "0.10"
5+
6+
install:
7+
- BROWSER="Firefox-aurora" ./.travis-setup.sh
8+
9+
before_script:
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"karma-firefox-launcher": "~0.1.3",
1919
"karma-ie-launcher": "~0.1.5",
2020
"karma-safari-launcher": "~0.1.1"
21+
},
22+
"scripts": {
23+
"test": "grunt test"
2124
}
2225
}

test/karma-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
'karma-chrome-launcher',
77
'karma-firefox-launcher'
88
],
9-
browsers: ['Chrome', 'Firefox'],
9+
browsers: ['Firefox'],
1010
// browsers: ['Safari', 'Chrome', 'ChromeCanary', 'Firefox', 'IE'],
1111
basePath: '.',
1212
files: [
1313
// Populated in `grunt test` task.
1414
],
1515
singleRun: true,
1616
port: 9876,
17-
reporters: ['progress'],
17+
reporters: ['dots'],
1818
colors: true,
1919
autoWatch: false,
2020
};

0 commit comments

Comments
 (0)