diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd76d09df9..d1d3fca94f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,48 +213,6 @@ jobs: if: steps.retry.outcome == 'failure' run: ${{ matrix.cmd }} - # Run the integration, find and mapreduce tests using pouchdb-server as the - # remote adapter. This checks that pouchdb-server works with the current - # PouchDB source tree. We run this on Node.js and on every target browser. - # Running against different versions of Node.js might require splitting this - # out into a distinct job. - - pouchdb-server: - needs: lint - strategy: - fail-fast: false - matrix: - client: ['node', '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: - CLIENT: ${{ matrix.client }} - SERVER: pouchdb-server - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - uses: ./.github/actions/install-node-package - with: - node-version: ${{ env.NODE_VERSION }} - - if: ${{ matrix.client != 'node' }} - 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. diff --git a/.gitignore b/.gitignore index ceac637c73..4cc22f2d95 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ lib_unit src_browser/ tests/integration/utils-bundle.js *.heapsnapshot -/pouchdb-server-install package-lock.json yarn.lock /.eslintcache diff --git a/TESTING.md b/TESTING.md index 2956490c7a..745b99c868 100644 --- a/TESTING.md +++ b/TESTING.md @@ -146,15 +146,9 @@ following values: - `pouchdb-express-router` (default): a minimal implementation of the CouchDB API that supports the replication protocol but not the `query()` or `find()` methods. -- `pouchdb-server`: this is a full reimplementation of the CouchDB API on top of - PouchDB, including Mango and map-reduce queries. - `couchdb-master`: use this value if you already have CouchDB running; it causes `COUCH_HOST` to be set to the correct value. -#### `SKIP_MIGRATION` (default: `0`) - -Set this to `1` to skip the migration tests. - #### `VIEW_ADAPTERS` (default: `memory`) Comma-separated list of preferred view adapter backends that PouchDB will use. @@ -199,13 +193,6 @@ setting `ADAPTERS=http` and pointing `COUCH_HOST` at our server: $ TYPE=mapreduce ADAPTERS=http COUCH_HOST='' npm test -And we test [pouchdb-server](https://github.com/pouchdb/pouchdb-server) using -the current PouchDB source tree. This is an implementation of the CouchDB API -and supports the `find()` and `query()` methods. Run the test suites against it -like so: - - $ TYPE=mapreduce ADAPTERS=http SERVER=pouchdb-server npm test - Note that the default choice for the `SERVER` value (`pouchdb-express-router`) does not support `find` or `mapreduce` and does not need to pass these tests. diff --git a/bin/run-test.sh b/bin/run-test.sh index 4fcfdfcfb3..df7694d6a8 100755 --- a/bin/run-test.sh +++ b/bin/run-test.sh @@ -19,54 +19,6 @@ fi : "${VIEW_ADAPTERS:=memory}" export VIEW_ADAPTERS -pouchdb-setup-server() { - # in CI, link pouchdb-servers dependencies on pouchdb - # modules to the current implementations - if [ -d "pouchdb-server-install" ]; then - rm -rf pouchdb-server-install - fi - mkdir pouchdb-server-install - cd pouchdb-server-install - npm init -y - npm install pouchdb-server - cd .. - - for pkg in packages/node_modules/* ; do - pouchdb-link-server-modules "$(basename "$pkg")" - done - - TESTDIR=./tests/pouchdb_server - rm -rf $TESTDIR && mkdir -p $TESTDIR - FLAGS=("$POUCHDB_SERVER_FLAGS" --dir "$TESTDIR") - echo -e "Starting up pouchdb-server with flags: ${FLAGS[*]} \n" - ./pouchdb-server-install/node_modules/.bin/pouchdb-server -n -p 6984 "${FLAGS[@]}" & - export SERVER_PID=$! -} - -pouchdb-link-server-modules() { - local pkg="$1" - - cd "packages/node_modules/${pkg}" - npm link - cd ../../../pouchdb-server-install/ - - # node_modules of pouchdb-server-install - if [ -d "node_modules/${pkg}" ]; then - echo -e "\nnpm link ${pkg} for pouchdb-server-install" - npm link "${pkg}" - fi - - # internal node_modules of other packages - for subPkg in node_modules/**/node_modules/"$pkg"; do - cd "$subPkg/../.." - echo -e "\nnpm link ${pkg} for ${subPkg}" - npm link "${pkg}" - cd ../.. - done - - cd .. -} - search-free-port() { EXPRESS_PORT=3000 while (: < /dev/tcp/127.0.0.1/$EXPRESS_PORT) 2>/dev/null; do @@ -87,14 +39,7 @@ if [[ $CI = true ]] && [[ $CLIENT != node ]]; then fi if [[ -n $SERVER ]]; then - if [ "$SERVER" == "pouchdb-server" ]; then - export COUCH_HOST='http://127.0.0.1:6984' - if [[ -n "$GITHUB_REPOSITORY" || "$COVERAGE" == 1 ]]; then - pouchdb-setup-server - else - echo -e "pouchdb-server should be running on $COUCH_HOST\n" - fi - elif [ "$SERVER" == "couchdb-master" ]; then + if [ "$SERVER" == "couchdb-master" ]; then if [ -z $COUCH_HOST ]; then export COUCH_HOST="http://127.0.0.1:5984" fi @@ -104,14 +49,8 @@ if [[ -n $SERVER ]]; then node ./tests/misc/pouchdb-express-router.js & export SERVER_PID=$! export COUCH_HOST="http://127.0.0.1:${PORT}" - elif [ "$SERVER" == "express-pouchdb-minimum" ]; then - pouchdb-build-node - node ./tests/misc/express-pouchdb-minimum-for-pouchdb.js & - export SERVER_PID=$! - export COUCH_HOST='http://127.0.0.1:3000' else - # I mistype pouchdb-server a lot - echo -e "Unknown SERVER $SERVER. Did you mean pouchdb-server?\n" + echo -e "Unknown SERVER $SERVER.\n" exit 1 fi fi diff --git a/bin/test-browser.js b/bin/test-browser.js index e959ec2c6d..031b25fc68 100755 --- a/bin/test-browser.js +++ b/bin/test-browser.js @@ -50,7 +50,6 @@ const qs = { viewAdapters: process.env.VIEW_ADAPTERS, autoCompaction: process.AUTO_COMPACTION, SERVER: process.env.SERVER, - SKIP_MIGRATION: process.env.SKIP_MIGRATION, srcRoot: process.env.SRC_ROOT, src: process.env.POUCHDB_SRC, useMinified: process.env.USE_MINIFIED, diff --git a/docs/adapters.md b/docs/adapters.md index 6f49dac2c6..c8f0a6591e 100644 --- a/docs/adapters.md +++ b/docs/adapters.md @@ -178,8 +178,6 @@ Currently PouchDB has full support for: * CouchDB 2.x ([tested in CI](https://github.com/pouchdb/pouchdb/actions)) * CouchDB 3.x ([tested in CI](https://github.com/pouchdb/pouchdb/actions)) * [Cloudant](https://cloudant.com/) (roughly the same as 2.x) -* [PouchDB Server](https://github.com/pouchdb/pouchdb-server) ([tested in CI](https://github.com/pouchdb/pouchdb/actions)) -* [PouchDB Server --in-memory mode](https://github.com/pouchdb/pouchdb-server) [Drupal 8](http://wearepropeople.com/blog/a-content-staging-solution-for-drupal-8-and-more) has also announced support for PouchDB, and there is [rcouch](https://github.com/rcouch/rcouch) as well, but these are both untested by PouchDB. @@ -189,12 +187,14 @@ If you are ever unsure about a server, consider replicating from PouchDB to Couc [PouchDB Server](https://github.com/pouchdb/pouchdb-server) is a standalone REST server that implements the CouchDB API, while using a LevelDB-based PouchDB under the hood. It also supports an `--in-memory` mode and any [LevelDOWN][] adapter, which you may find handy. -PouchDB Server passes the PouchDB test suite at 100%, but be aware that it is not as full-featured or battle-tested as CouchDB. +PouchDB Server is not currently maintained, so it is not currently supported or tested against in this repository. #### PouchDB Express The underlying module for PouchDB Server, [Express PouchDB](https://github.com/pouchdb/express-pouchdb) is an Express submodule that mimics most of the CouchDB API within your Express application. +Like PouchDB Server above, this module is not currently maintained, so it is not currently supported or tested against in this repository. + {% include anchor.html title="More resources" hash="more_resources"%} The best place to look for information on which browsers support which databases is [caniuse.com](http://caniuse.com). You can consult their tables on browser support for various backends: diff --git a/docs/getting-started.md b/docs/getting-started.md index d7d7d7bf3b..d688a92662 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -161,7 +161,7 @@ function todoBlurred(todo, event) { {% include anchor.html class="h3" title="Installing CouchDB" hash="installing_couchdb" %} -Now we'll implement the syncing. You need to have a compatible server instance. You can install either [PouchDB-Server](https://github.com/pouchdb/pouchdb-server), [CouchDB](http://couchdb.apache.org/) or use an hosted Couch service such as [Cloudant](https://cloudant.com/) +Now we'll implement the syncing. You need to have a compatible server instance. You can either install [CouchDB](http://couchdb.apache.org/) or use an hosted Couch service such as [Cloudant](https://cloudant.com/) {% include anchor.html class="h3" title="Enabling CORS" hash="enabling_cors" %} diff --git a/package.json b/package.json index c8d51f46fa..db6336eef4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "publish-site": "./bin/publish-site.sh", "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", + "coverage": "COVERAGE=1 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", @@ -73,7 +73,6 @@ "derequire": "2.1.1", "eslint": "8.7.0", "express": "4.17.0", - "express-pouchdb": "4.2.0", "find-requires": "1.0.0", "glob": "7.1.5", "http-server": "0.12.3", diff --git a/tests/integration/browser.migration.js b/tests/integration/browser.migration.js index db3d710e98..88a04cd924 100644 --- a/tests/integration/browser.migration.js +++ b/tests/integration/browser.migration.js @@ -37,11 +37,7 @@ describe('migration', function () { var isNodeWebkit = typeof window !== 'undefined' && typeof process !== 'undefined'; - var skipMigration = 'SKIP_MIGRATION' in testUtils.params() && - testUtils.params().SKIP_MIGRATION; - - if (!usingDefaultPreferredAdapters() || window.msIndexedDB || - isNodeWebkit || skipMigration) { + if (!usingDefaultPreferredAdapters() || window.msIndexedDB || isNodeWebkit) { skip = true; return this.skip(); } diff --git a/tests/integration/test.attachments.js b/tests/integration/test.attachments.js index e87efbc2df..a0ac5853ea 100644 --- a/tests/integration/test.attachments.js +++ b/tests/integration/test.attachments.js @@ -2064,7 +2064,7 @@ adapters.forEach(function (adapter) { err.status.should.equal(400); const body = await err.json(); body.reason.should.equal('_local documents do not accept attachments.'); - } else if (serverType === 'pouchdb-express-router' || serverType === 'express-pouchdb') { + } else if (serverType === 'pouchdb-express-router') { err.status.should.equal(404); const body = await err.json(); body.reason.should.equal('missing'); @@ -2090,7 +2090,7 @@ adapters.forEach(function (adapter) { if (serverType === 'couchdb') { should.not.exist(doc._attachments); - } else if (serverType === 'pouchdb-express-router' || serverType === 'express-pouchdb') { + } else if (serverType === 'pouchdb-express-router') { doc._attachments['foo.txt'].content_type.should.equal('text/plain'); JSON.parse(decodeBase64(doc._attachments['foo.txt'].data)).should.deep.equal({ error: 'not_found', diff --git a/tests/integration/utils.js b/tests/integration/utils.js index 3f727a6a2e..bd971f5592 100644 --- a/tests/integration/utils.js +++ b/tests/integration/utils.js @@ -171,14 +171,13 @@ testUtils.isCouchDB = function (cb) { PouchDB.fetch(url, options).then(function (response) { return response.json(); }).then(function (res) { - cb('couchdb' in res || 'express-pouchdb' in res); + cb('couchdb' in res); }); }; testUtils.getServerType = async () => { const knownServers = [ 'couchdb', - 'express-pouchdb', 'pouchdb-express-router', ]; diff --git a/tests/misc/express-pouchdb-minimum-for-pouchdb.js b/tests/misc/express-pouchdb-minimum-for-pouchdb.js deleted file mode 100644 index ed7d17f1d3..0000000000 --- a/tests/misc/express-pouchdb-minimum-for-pouchdb.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var PouchDB = require('../../'); - -var app = require('express-pouchdb')(PouchDB, { - mode: 'minimumForPouchDB' -}); -app.listen(3000);