diff --git a/acceptance/repository-cloudant/README.md b/acceptance/repository-cloudant/README.md index 15644973b689..b6b4a0cfa9a8 100644 --- a/acceptance/repository-cloudant/README.md +++ b/acceptance/repository-cloudant/README.md @@ -36,19 +36,30 @@ npm test ### Using Docker (Linux, MacOS, WSL) If you do not have a local Cloudant instance, you can also run the test suite -with very minimal requirements. +with very minimal requirements. We use couchDB docker image to run the test +locally. -- Assuming you have [Docker](https://docs.docker.com/engine/installation/) - installed, run the following script which would spawn a Cloudant instance on - your local: +NOTICE: we use `couchDB3` docker image for testing Cloudant because Cloudant +doesn't have a maintained image, and most of the their functionalities are the +same (except couchDB doesn't support geosearch). - ```bash - source setup.sh - ``` +- Install [Docker](https://docs.docker.com/engine/installation/). + +- Use the `couchDB3:latest` image, and rename the container as + `cloudant-testdb`. + +- Start the container, and create an admin and password for this image at + `http://localhost:{YOURPORT}/_utils/` if it doesn't have any yet. + +- Then run the following script + +```bash +source setup.sh +``` - Where ``, ``, ``, ``, `` and `` are - optional parameters. The default values are `url`, `localhost`, `3306`, - `root`, `pass` and `testdb` respectively. +Where ``, ``, ``, `` and `` are optional +parameters. The default values are `localhost`, `8080`, `admin`, `pass` and +`testdb` respectively. - Run the test: diff --git a/acceptance/repository-cloudant/src/__tests__/cloudant.datasource.ts b/acceptance/repository-cloudant/src/__tests__/cloudant.datasource.ts index bff1347c2bc3..07056b69a9b7 100644 --- a/acceptance/repository-cloudant/src/__tests__/cloudant.datasource.ts +++ b/acceptance/repository-cloudant/src/__tests__/cloudant.datasource.ts @@ -3,18 +3,17 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { CrudFeatures, DataSourceOptions } from '@loopback/repository-tests'; +import {CrudFeatures, DataSourceOptions} from '@loopback/repository-tests'; const connector = require('loopback-connector-cloudant'); export const CLOUDANT_CONFIG: DataSourceOptions = { connector, host: process.env.CLOUDANT_HOST || 'localhost', - port: process.env.CLOUDANT_PORT || 5984, + port: process.env.CLOUDANT_PORT || 8080, username: process.env.CLOUDANT_USER || 'admin', password: process.env.CLOUDANT_PASSWORD || 'pass', database: process.env.CLOUDANT_DATABASE || 'testdb', - url: process.env.CLOUDANT_URL || 'http://admin:pass@localhost:5984', }; export const CLOUDANT_FEATURES: Partial = {