Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 1 addition & 181 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,194 +46,14 @@ jobs:
- run: sudo apt-get install shellcheck
- run: git ls-files '*.sh' | xargs shellcheck

# Run the integration, find and mapreduce tests against CouchDB on Node.js.
# This should be run against every version of CouchDB and every version of
# Node.js we support.

couchdb-nodejs:
needs: lint
strategy:
fail-fast: false
matrix:
couchdb: ['2.3', '3.1']
node: [18, 20]
cmd:
- npm test
- TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test
- TYPE=mapreduce ADAPTERS=http npm test
runs-on: ubuntu-latest
env:
CLIENT: node
SERVER: couchdb-master
COUCH_HOST: http://admin:[email protected]:5984
SKIP_MIGRATION: 1
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/install-node-package
with:
node-version: ${{ matrix.node }}
- uses: ./.github/actions/install-couchdb
with:
couchdb-version: ${{ matrix.couchdb }}
- uses: ./.github/actions/build-pouchdb
- id: test
run: ${{ matrix.cmd }}
continue-on-error: true
- name: First retry
id: retry
if: steps.test.outcome == 'failure'
run: ${{ matrix.cmd }}
continue-on-error: true
- name: Second retry
if: steps.retry.outcome == 'failure'
run: ${{ matrix.cmd }}

# Run the integration, find and mapreduce tests against CouchDB in the
# browser. This should be run against every version of CouchDB we support and
# every target browser.

couchdb-browser:
needs: lint
strategy:
fail-fast: false
matrix:
couchdb: ['2.3','3.1']
client: ['firefox', 'chromium', 'webkit']
cmd:
- npm test
- TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test
- TYPE=mapreduce ADAPTERS=http npm test
runs-on: ubuntu-latest
env:
USE_MINIFIED: 1
CLIENT: ${{ matrix.client }}
SERVER: couchdb-master
COUCH_HOST: http://admin:[email protected]:5984
SKIP_MIGRATION: 1
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/install-node-package
with:
node-version: ${{ env.NODE_VERSION }}
- uses: ./.github/actions/install-playwright
- uses: ./.github/actions/install-couchdb
with:
couchdb-version: ${{ matrix.couchdb }}
- uses: ./.github/actions/build-pouchdb
- id: test
run: ${{ matrix.cmd }}
continue-on-error: true
- name: First retry
id: retry
if: steps.test.outcome == 'failure'
run: ${{ matrix.cmd }}
continue-on-error: true
- name: Second retry
if: steps.retry.outcome == 'failure'
run: ${{ matrix.cmd }}

# Run the integration, find and mapreduce tests against all the Node.js
# PouchDB adapters. This should be run for every adapter on every version of
# Node.js we support.

nodejs-adapter:
needs: lint
strategy:
fail-fast: false
matrix:
node: [18, 20]
adapter: ['leveldb', 'memory']
cmd:
- npm test
- TYPE=find PLUGINS=pouchdb-find npm test
- TYPE=mapreduce npm test
runs-on: ubuntu-latest
env:
CLIENT: node
ADAPTERS: ${{ matrix.adapter }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/install-node-package
with:
node-version: ${{ matrix.node }}
- uses: ./.github/actions/build-pouchdb
- id: test
run: ${{ matrix.cmd }}
continue-on-error: true
- name: First retry
id: retry
if: steps.test.outcome == 'failure'
run: ${{ matrix.cmd }}
continue-on-error: true
- name: Second retry
if: steps.retry.outcome == 'failure'
run: ${{ matrix.cmd }}

# Run the integration, find and mapreduce tests against all the browser-based
# adapters. PouchDB adapters. This should be run for every adapter on every
# target browser.

browser-adapter:
needs: lint
strategy:
fail-fast: false
matrix:
client: ['firefox', 'chromium', 'webkit']
adapter: ['idb', 'indexeddb', 'memory']
cmd:
- npm test
- TYPE=find PLUGINS=pouchdb-find npm test
- TYPE=mapreduce npm test
runs-on: ubuntu-latest
env:
USE_MINIFIED: 1
CLIENT: ${{ matrix.client }}
ADAPTERS: ${{ matrix.adapter }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/install-node-package
with:
node-version: ${{ env.NODE_VERSION }}
- uses: ./.github/actions/install-playwright
- uses: ./.github/actions/build-pouchdb
- id: test
run: ${{ matrix.cmd }}
continue-on-error: true
- name: First retry
id: retry
if: steps.test.outcome == 'failure'
run: ${{ matrix.cmd }}
continue-on-error: true
- name: Second retry
if: steps.retry.outcome == 'failure'
run: ${{ matrix.cmd }}

# Run all the other testing tasks -- unit tests, and so on. These should be
# run on every version of Node.js that we support.

nodejs:
needs: lint
strategy:
fail-fast: false
matrix:
node: [18, 20]
cmd:
- CLIENT=firefox npm run test-webpack
- AUTO_COMPACTION=true npm test
- PERF=1 npm test
- npm run test-unit
- npm run test-component
- npm run test-fuzzy
# - SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run report-coverage
- npm run verify-build
- SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run test-coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[PouchDB](https://pouchdb.com/) – The Database that Syncs!
=========

[![Build Status](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml?query=branch%3Amaster) [![Coverage Status](https://s3.amazonaws.com/assets.coveralls.io/badges/coveralls_100.svg)](https://coveralls.io/github/pouchdb/pouchdb?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/pouchdb/pouchdb.svg)](https://greenkeeper.io/) [![npm version](https://img.shields.io/npm/v/pouchdb.svg)](https://www.npmjs.com/package/pouchdb) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/pouchdb/badge?style=rounded)](https://www.jsdelivr.com/package/npm/pouchdb)
[![Build Status](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml?query=branch%3Amaster) [![Greenkeeper badge](https://badges.greenkeeper.io/pouchdb/pouchdb.svg)](https://greenkeeper.io/) [![npm version](https://img.shields.io/npm/v/pouchdb.svg)](https://www.npmjs.com/package/pouchdb) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/pouchdb/badge?style=rounded)](https://www.jsdelivr.com/package/npm/pouchdb)

PouchDB is an open-source JavaScript database inspired by [Apache CouchDB](http://couchdb.apache.org/) that is designed to run well within the browser.

Expand Down
15 changes: 7 additions & 8 deletions bin/test-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ fi
if [ $TYPE = "find" ]; then
TESTS_PATH="tests/find/*/test.*.js"
fi
if [ "$COVERAGE" ]; then
# run all tests when testing for coverage
TESTS_PATH="tests/{unit,integration,mapreduce,component}/test*.js tests/find/*/test.*.js"
fi

if [ "$PERF" ]; then
node tests/performance/index.js
Expand All @@ -47,8 +43,11 @@ elif [ ! "$COVERAGE" ]; then
--grep="$GREP" \
"$TESTS_PATH"
else
# Ignore TESTS_PATH:
# run all tests when testing for coverage

# --exit required to workaround #8839
./node_modules/.bin/istanbul cover \
./node_modules/.bin/nyc \
--no-default-excludes -x 'tests/**' -x 'node_modules/**' \
./node_modules/mocha/bin/_mocha -- \
--exit \
Expand All @@ -57,9 +56,9 @@ else
--require=./tests/integration/node.setup.js \
--reporter="$REPORTER" \
--grep="$GREP" \
"$TESTS_PATH"

./node_modules/.bin/istanbul check-coverage --line 100
'tests/{unit,integration,mapreduce,component}/test*.js' \
'tests/find/*/test.*.js'
./node_modules/.bin/nyc check-coverage --line 100
fi

EXIT_STATUS=$?
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"build-site": "node ./bin/build-site.js",
"test-coverage": "./bin/test-coverage.sh",
"coverage": "COVERAGE=1 SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find ./bin/test-coverage.sh",
"report-coverage": "npm run test-coverage && istanbul-coveralls --no-rm",
"build-test": "npm run build-test-utils && npm run build-perf",
"build-test-utils": "browserify tests/integration/utils.js > tests/integration/utils-bundle.js",
"build-perf": "browserify tests/performance/index.js > tests/performance-bundle.js",
Expand Down Expand Up @@ -76,15 +75,14 @@
"glob": "7.1.5",
"glob-watcher": "^6.0.0",
"http-server": "0.12.3",
"istanbul": "0.4.5",
"istanbul-coveralls": "1.0.3",
"less": "3.9.0",
"lodash": "4.17.21",
"marky": "1.2.5",
"median": "0.0.2",
"mkdirp": "0.5.1",
"mocha": "10.2.0",
"ncp": "2.0.0",
"nyc": "^15.1.0",
"playwright": "1.42.1",
"pouchdb-express-router": "0.0.11",
"replace": "1.2.1",
Expand Down
Loading