Skip to content

Commit 0ad01aa

Browse files
authored
Merge pull request #115 from pouchdb-community/upgrade-selenium
Use the latest selenium and update to pouchdb 7.0.0
2 parents 905d90b + fed30c2 commit 0ad01aa

File tree

5 files changed

+62
-26
lines changed

5 files changed

+62
-26
lines changed

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
language: node_js
2+
dist: xenial
23
services:
3-
- couchdb
4-
sudo: false
4+
- xvfb
5+
sudo: true
56
node_js:
6-
- "5"
7+
- "8"
8+
79
script: npm run $COMMAND
8-
before_script:
9-
- "export DISPLAY=:99.0"
10-
- "sh -e /etc/init.d/xvfb start"
11-
- "npm install add-cors-to-couchdb"
12-
- "./node_modules/.bin/add-cors-to-couchdb"
10+
1311
env:
1412
matrix:
1513
- COMMAND=test
16-
- CLIENT=selenium:phantomjs COMMAND=test
14+
- CLIENT=selenium:firefox COMMAND=test
1715
- COMMAND=coverage
1816
branches:
1917
only:

bin/run-couchdb-on-travis.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
COUCH_PORT=5984
4+
if [ "$SERVER" = "couchdb-master" ]; then
5+
# Install CouchDB 2.X (clustered)
6+
docker run -d -p 5984:5984 apache/couchdb:latest --with-haproxy --with-admin-party-please -n 1
7+
else
8+
# Install CouchDB 1.X
9+
docker run -d -p 5984:5984 apache/couchdb:1
10+
fi
11+
12+
# wait for couchdb to start, add cors
13+
npm install add-cors-to-couchdb
14+
while [ '200' != $(curl -s -o /dev/null -w %{http_code} http://127.0.0.1:${COUCH_PORT}) ]; do
15+
echo waiting for couch to load... ;
16+
sleep 1;
17+
done
18+
./node_modules/.bin/add-cors-to-couchdb http://127.0.0.1:${COUCH_PORT}

bin/run-test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
#!/bin/bash
22

3+
export COUCH_HOST='http://127.0.0.1:5984'
4+
5+
if [ ! -z $TRAVIS ]; then
6+
source ./bin/run-couchdb-on-travis.sh
7+
fi
8+
9+
printf 'Waiting for host to start .'
10+
WAITING=0
11+
until $(curl --output /dev/null --silent --head --fail --max-time 2 $COUCH_HOST); do
12+
if [ $WAITING -eq 4 ]; then
13+
printf '\nHost failed to start\n'
14+
exit 1
15+
fi
16+
let WAITING=WAITING+1
17+
printf '.'
18+
sleep 5
19+
done
20+
printf '\nHost started :)'
21+
322
: ${CLIENT:="node"}
423

524
if [ "$CLIENT" == "node" ]; then

bin/test-browser.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var testTimeout = 30 * 60 * 1000;
1212

1313
var username = process.env.SAUCE_USERNAME;
1414
var accessKey = process.env.SAUCE_ACCESS_KEY;
15+
var SELENIUM_VERSION = process.env.SELENIUM_VERSION || '3.141.0';
1516

1617
// process.env.CLIENT is a colon seperated list of
1718
// (saucelabs|selenium):browserName:browserVerion:platform
@@ -46,9 +47,9 @@ testUrl += '?';
4647
testUrl += querystring.stringify(qs);
4748

4849
if (process.env.TRAVIS &&
49-
client.browser !== 'firefox' &&
50-
client.browser !== 'phantomjs' &&
51-
process.env.TRAVIS_SECURE_ENV_VARS === 'false') {
50+
client.browser !== 'firefox' &&
51+
client.browser !== 'phantomjs' &&
52+
process.env.TRAVIS_SECURE_ENV_VARS === 'false') {
5253
console.error('Not running test, cannot connect to saucelabs');
5354
process.exit(1);
5455
return;
@@ -81,13 +82,13 @@ function testComplete(result) {
8182

8283
function startSelenium(callback) {
8384
// Start selenium
84-
var opts = {version: '2.42.0'};
85-
selenium.install(opts, function(err) {
85+
var opts = { version: SELENIUM_VERSION };
86+
selenium.install(opts, function (err) {
8687
if (err) {
8788
console.error('Failed to install selenium');
8889
process.exit(1);
8990
}
90-
selenium.start(opts, function(err, server) {
91+
selenium.start(opts, function (err, server) {
9192
sauceClient = wd.promiseChainRemote();
9293
callback();
9394
});

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@
3535
"argsarray": "0.0.1",
3636
"es3ify": "^0.2.2",
3737
"inherits": "~2.0.3",
38-
"lie": "^3.1.1",
38+
"lie": "^3.3.0",
3939
"pouchdb-extend": "^0.1.2",
40-
"pouchdb-promise": "^6.4.2",
40+
"pouchdb-promise": "^6.4.3",
4141
"uniq": "^1.0.1"
4242
},
4343
"peerDependencies": {
44-
"pouchdb-find": "^6.4.2"
44+
"pouchdb-find": "^7.0.0"
4545
},
4646
"devDependencies": {
4747
"blob-util": "^1.3.0",
48-
"bluebird": "^3.5.1",
49-
"browserify": "^15.0.0",
48+
"bluebird": "^3.5.4",
49+
"browserify": "^15.2.0",
5050
"chai": "~3.5.0",
5151
"chai-as-promised": "~5.3.0",
5252
"http-server": "~0.10.0",
5353
"istanbul": "^0.4.5",
5454
"jshint": "2.9.5",
5555
"mocha": "~4.1.0",
5656
"phantomjs-prebuilt": "^2.1.16",
57-
"pouchdb-find": "^6.4.2",
57+
"pouchdb-find": "^7.0.0",
5858
"pouchdb-memory": "^6.0.0",
59-
"request": "^2.83.0",
60-
"sauce-connect-launcher": "^1.2.3",
61-
"selenium-standalone": "6.12.0",
62-
"uglify-js": "^3.3.5",
59+
"request": "^2.88.0",
60+
"sauce-connect-launcher": "1.2.6",
61+
"selenium-standalone": "6.16.0",
62+
"uglify-js": "^3.5.6",
6363
"watchify": "~3.9.0",
64-
"wd": "^1.5.0",
64+
"wd": "1.11.2",
6565
"mkdirp": "^0.5.1"
6666
},
6767
"files": [

0 commit comments

Comments
 (0)