forked from pouchdb/pouchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
144 lines (117 loc) · 5.09 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
language: node_js
node_js:
- "6"
services:
- docker
git:
depth: 30
sudo:
false
addons:
jwt:
secure: YlCp9qGHmnnATcScIQVyOt8eI9FxLhMGAz9iRTHh7r41ADjfGJUzyqkWoBLcCagiQWtqtUujukPAtRuOibbBp9SvmGp+IIdbwHVUDvSZNOvGxkQ1qczeGxJcnht+2YNoCwfzkHW4vFrNiGOULdjvbWAB4sAJ8N0AZPShURwXU1E=
before_install:
# Because Saucelabs doesnt proxy 5984 on OSX
- "if [ -z \"$COUCH_HOST\" ]; then export COUCH_HOST=http://127.0.0.1:3000; fi"
before_script:
# Our test-browser.js script uses FIREFOX_BIN to find the Firefox binary
# See https://github.com/travis-ci/travis-ci/issues/4649
- echo "using firefox $(firefox --version)"
- export FIREFOX_BIN=$(which firefox)
# The next two lines are required for Firefox to run on Travis
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
# Install PhantomJS and cache it
# See https://github.com/Medium/phantomjs#continuous-integration
- "export PHANTOMJS_VERSION=2.1.1"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"
# Fail early so we dont run hours of saucelabs if we know there
# is a lint failure
- npm run eslint
# travis_retry will try up to 3 times to run the script. our tests
# are flaky enough (Selenium, SauceLabs, network, etc.) that this
# mitigates a lot of false negatives
script: travis_retry npm run $COMMAND
env:
global:
- NPM_CONFIG_PROGRESS="false"
- SAUCE_USERNAME=pouchdb
matrix:
- CLIENT=node COMMAND=test
# Test WebSQL in Node (using node-websql)
- CLIENT=node ADAPTER=websql COMMAND=test
# Test in-memory in Node
- CLIENT=node ADAPTER=memory COMMAND=test
# Test in firefox/phantomjs running on travis
- CLIENT=selenium:firefox COMMAND=test
- CLIENT=selenium:phantomjs COMMAND=test
# Test auto-compaction in Node, Phantom, and Firefox
- AUTO_COMPACTION=true CLIENT=node COMMAND=test
- AUTO_COMPACTION=true CLIENT=selenium:firefox COMMAND=test
- AUTO_COMPACTION=true CLIENT=selenium:phantomjs COMMAND=test
# Test map/reduce
- TYPE=mapreduce CLIENT=node COMMAND=test
- TYPE=mapreduce CLIENT=selenium:firefox COMMAND=test
- TYPE=mapreduce CLIENT=selenium:phantomjs COMMAND=test
# Test pouchdb-find
- COUCH_HOST=http://127.0.0.1:3001 TYPE=find PLUGINS=pouchdb-find CLIENT=node SERVER=couchdb-master COMMAND=test
- TYPE=find PLUGINS=pouchdb-find CLIENT=selenium:firefox SERVER=pouchdb-server COMMAND=test
# Testing in saucelabs
- CLIENT=saucelabs:chrome COMMAND=test
- FETCH=1 CLIENT=selenium:firefox COMMAND=test
- CLIENT=saucelabs:safari:7 COMMAND=test
- CLIENT="saucelabs:internet explorer:10:Windows 8" COMMAND=test
# split up the android+iphone tests as it goes over time
- SKIP_MIGRATION=true CLIENT="saucelabs:iphone:8.1:OS X 10.10" COMMAND=test
- CLIENT="saucelabs:Android:5.1:Linux" COMMAND=test
# Test memory / fruitdown etc
- CLIENT="saucelabs:iphone:8.4:OS X 10.11" ADAPTERS=fruitdown COMMAND=test
- CLIENT=selenium:firefox ADAPTERS=memory COMMAND=test
- CLIENT=selenium:firefox ADAPTERS=localstorage COMMAND=test
# Test Webpack bundle
- CLIENT=selenium:firefox COMMAND=test-webpack
# Test CouchDB master (aka bigcouch branch)
- COUCH_HOST=http://127.0.0.1:3001 CLIENT=node SERVER=couchdb-master COMMAND=test
- COUCH_HOST=http://127.0.0.1:3001 SKIP_MIGRATION=true CLIENT=selenium:firefox SERVER=couchdb-master COMMAND=test
# Performance tests
- CLIENT=selenium:firefox PERF=1 COMMAND=test
- PERF=1 COMMAND=test
# Test Webpack bundle
- CLIENT=selenium:firefox NEXT=1 COMMAND=test
- COMMAND=test-unit
- COMMAND=test-component
- COMMAND=test-fuzzy
# need extra env variable COVERAGE here because of some subtlety in Travis containers not
# passing the process.env.COVERAGE to the node process
- COMMAND=report-coverage COVERAGE=1 SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find
- COMMAND=verify-build
matrix:
fast_finish: true
include:
- node_js: "4"
services: docker
env: CLIENT=node COMMAND=test
- node_js: "7"
services: docker
env: CLIENT=node COMMAND=test
- node_js: "8"
services: docker
env: CLIENT=node COMMAND=test
allow_failures:
- env: CLIENT="saucelabs:iphone:8.4:OS X 10.11" ADAPTERS=fruitdown COMMAND=test
- env: CLIENT=selenium:firefox ADAPTERS=localstorage COMMAND=test
branches:
only:
- master
- /^greenkeeper/.*$/
cache:
directories:
- $HOME/.npm
# See https://github.com/gr2m/selsa
- node_modules/selenium-standalone/.selenium
# See https://github.com/Medium/phantomjs#continuous-integration
- travis_phantomjs