Skip to content
Merged
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
22 changes: 17 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ matrix:
env: TASK=code-lint
# Running Code Linter -- Requires @loopback/build so it's bootstrapped
script:
- lerna bootstrap --scope @loopback/build --include-filtered-dependencies
- lerna bootstrap --scope @loopback/build --include-dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2019-10-18 at 12 21 21 AM

Replacing because --include-filtered-dependencies has been renamed.

- npm run lint
- node_js: "8"
os: linux
Expand All @@ -47,8 +47,8 @@ matrix:
services:
- mongodb
script:
- npm run postinstall -- --scope "@loopback/test-repository-mongodb" --include-filtered-dependencies
- npm run build -- --scope "@loopback/test-repository-mongodb" --include-filtered-dependencies
- npm run postinstall -- --scope "@loopback/test-repository-mongodb" --include-dependencies
- npm run build -- --scope "@loopback/test-repository-mongodb" --include-dependencies
- cd acceptance/repository-mongodb && npm run mocha
- node_js: "10"
os: linux
Expand All @@ -64,9 +64,21 @@ matrix:
- mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' WITH GRANT OPTION;FLUSH PRIVILEGES;"
- mysql -e "GRANT SUPER ON *.* TO 'test'@'localhost' IDENTIFIED BY 'test';FLUSH PRIVILEGES;"
script:
- npm run postinstall -- --scope "@loopback/test-repository-mysql" --include-filtered-dependencies
- npm run build -- --scope "@loopback/test-repository-mysql" --include-filtered-dependencies
- npm run postinstall -- --scope "@loopback/test-repository-mysql" --include-dependencies
- npm run build -- --scope "@loopback/test-repository-mysql" --include-dependencies
- cd acceptance/repository-mysql && npm run mocha
- node_js: "10"
os: linux
env:
- TASK=test-repository-postgresql
- POSTGRESQL_USER=postgres
services:
- postgresql
script:
- npm run postinstall -- --scope "@loopback/test-repository-postgresql" --include-dependencies
- npm run build -- --scope "@loopback/test-repository-postgresql" --include-dependencies
- psql -U postgres -a -f acceptance/repository-postgresql/test/schema.sql
- cd acceptance/repository-postgresql && npm run mocha

branches:
only:
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

acceptance/repository-mongodb/* @bajtos
acceptance/repository-mysql/* @bajtos
acceptance/repository-postgresql/* @nabdelgadir

packages/authentication/* @bajtos @raymondfeng
packages/boot/* @raymondfeng @hacksparrow
Expand Down
2 changes: 1 addition & 1 deletion acceptance/repository-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@loopback/test-repository-mongodb",
"version": "0.4.8",
"description": "",
"private": "true",
"private": true,
"engines": {
"node": ">=8.9"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/test-repository-mysql
// Node module: @loopback/test-repository-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand All @@ -11,7 +11,7 @@ export const MONGODB_CONFIG: DataSourceOptions = {
connector,
host: process.env.MONGODB_HOST || 'localhost',
port: process.env.MONGODB_PORT || 27017,
database: process.env.MONGODB_DATABASE || 'repository-tests',
database: process.env.MONGODB_DATABASE || 'repository_tests',
};

export const MONGODB_FEATURES: Partial<CrudFeatures> = {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/repository-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@loopback/test-repository-mysql",
"version": "0.4.8",
"description": "",
"private": "true",
"private": true,
"engines": {
"node": ">=8.9"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const MYSQL_CONFIG: DataSourceOptions = {
connector,
host: process.env.MYSQL_HOST || 'localhost',
port: process.env.MYSQL_PORT || 3306,
database: process.env.MYSQL_DATABASE || 'repository-tests',
database: process.env.MYSQL_DATABASE || 'repository_tests',
username: process.env.MYSQL_USER || 'root',
password: process.env.MYSQL_PASSWORD || '',
createDatabase: true,
Expand Down
1 change: 1 addition & 0 deletions acceptance/repository-postgresql/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=true
Empty file.
25 changes: 25 additions & 0 deletions acceptance/repository-postgresql/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) IBM Corp. 2019. All Rights Reserved.
Node module: @loopback/test-repository-postgresql
This project is licensed under the MIT License, full text below.

--------

MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
66 changes: 66 additions & 0 deletions acceptance/repository-postgresql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# @loopback/test-repository-postgresql

Acceptance tests for `@loopback/repository` + `loopback-connector-postgresql`.

## Running the test suite

### Using own PostgreSQL instance

If you have a local PostgreSQL instance listening on `localhost` and the default
port, with a `root` user and an empty password, use the following command:

```bash
npm test
```

If you have a local or remote PostgreSQL instance and would like to use that to
run the test suite, use the following command:

**Linux & MacOS**

```bash
POSTGRESQL_HOST=<HOST> POSTGRESQL_PORT=<PORT> POSTGRESQL_USER=<USER> POSTGRESQL_PASSWORD=<PASSWORD> POSTGRESQL_DATABASE=<DATABASE> npm test
```

**Windows**

```bash
SET POSTGRESQL_HOST=<HOST>
SET POSTGRESQL_PORT=<PORT>
SET POSTGRESQL_USER=<USER>
SET POSTGRESQL_PASSWORD=<PASSWORD>
SET POSTGRESQL_DATABASE=<DATABASE>
npm test
```

### Using Docker (Linux, MacOS, WSL)

If you do not have a local PostgreSQL instance, you can also run the test suite
with very minimal requirements.

- Assuming you have [Docker](https://docs.docker.com/engine/installation/)
installed, run the following script which would spawn a PostgreSQL instance on
your local:

```bash
source setup.sh <HOST> <PORT> <USER> <PASSWORD> <DATABASE>
```

Where `<HOST>`, `<PORT>`, `<USER>`, `<PASSWORD>` and `<DATABASE>` are optional
parameters. The default values are `localhost`, `5432`, `root`, `pass` and
both `repository_tests` and `repository_tests_new` respectively.

- Run the test:

```bash
npm test
```

## Contributors

See
[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors).

## License

MIT
6 changes: 6 additions & 0 deletions acceptance/repository-postgresql/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/test-repository-postgresql
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

export * from './dist';
6 changes: 6 additions & 0 deletions acceptance/repository-postgresql/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/test-repository-postgresql
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

module.exports = require('./dist');
8 changes: 8 additions & 0 deletions acceptance/repository-postgresql/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/test-repository-postgresql
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

// DO NOT EDIT THIS FILE
// Add any additional (re)exports to src/index.ts instead.
export * from './src';
Loading