diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..6a1873af7d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,110 @@ +name: ci +on: + push: + branches: + - master + pull_request: + branches: + - '**' +env: + COVERAGE_OPTION: ./node_modules/.bin/nyc + NODE_VERSION: 10 + PARSE_SERVER_TEST_TIMEOUT: 20000 +jobs: + check-mongo: + strategy: + matrix: + include: + - name: Mongo 4.0.4, ReplicaSet, WiredTiger + MONGODB_VERSION: 4.0.4 + MONGODB_TOPOLOGY: replicaset + MONGODB_STORAGE_ENGINE: wiredTiger + NODE_VERSION: 10 + - name: Mongo 3.6.21 + MONGODB_VERSION: 3.6.21 + NODE_VERSION: 10 + - name: Redis Cache + PARSE_SERVER_TEST_CACHE: redis + NODE_VERSION: 10 + - name: Node 12.12.0 + NODE_VERSION: 12.12.0 + name: ${{ matrix.name }} + timeout-minutes: 30 + runs-on: ubuntu-18.04 + services: + redis: + image: redis + ports: + - 6379:6379 + env: + MONGODB_VERSION: ${{ matrix.MONGODB_VERSION }} + MONGODB_TOPOLOGY: ${{ matrix.MONGODB_TOPOLOGY }} + MONGODB_STORAGE_ENGINE: ${{ matrix.MONGODB_STORAGE_ENGINE }} + PARSE_SERVER_TEST_CACHE: ${{ matrix.PARSE_SERVER_TEST_CACHE }} + NODE_VERSION: ${{ matrix.NODE_VERSION }} + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.NODE_VERSION }} + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- + - name: Install dependencies + run: npm ci + - if: ${{ matrix.name == 'Mongo 3.6.21' }} + run: npm run lint + - run: npm run pretest + - run: npm run coverage + env: + CI: true + - run: bash <(curl -s https://codecov.io/bash) + check-postgres: + name: Postgresql + timeout-minutes: 30 + runs-on: ubuntu-18.04 + services: + redis: + image: redis + ports: + - 6379:6379 + postgres: + image: postgis/postgis:11-3.0 + env: + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + PARSE_SERVER_TEST_DB: postgres + POSTGRES_MAJOR_VERSION: 11 + PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 10 + uses: actions/setup-node@v1 + with: + node-version: 10 + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- + - name: Install dependencies + run: npm ci + - run: bash scripts/before_script_postgres.sh + - run: npm run coverage + env: + CI: true + - run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a11f54b871..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,80 +0,0 @@ -language: node_js -os: linux -dist: xenial -services: -- redis -- docker -branches: - only: - - master - - "/^[0-9]+.[0-9]+.[0-9]+(-.*)?$/" - - 3.x - - 4.x - - "/^greenkeeper/.*$/" -cache: - directories: - - "$HOME/.npm" - - ".eslintcache" -env: - global: - - COVERAGE_OPTION='./node_modules/.bin/nyc' - jobs: - - MONGODB_VERSION=4.0.4 MONGODB_TOPOLOGY=replicaset MONGODB_STORAGE_ENGINE=wiredTiger - - MONGODB_VERSION=3.6.9 - - PARSE_SERVER_TEST_CACHE=redis - - NODE_VERSION=12.12.0 -before_install: -- nvm install $NODE_VERSION -- nvm use $NODE_VERSION -- npm install -g greenkeeper-lockfile@1 -before_script: -- node -e 'require("./lib/index.js")' -- greenkeeper-lockfile-update -script: -- npm run lint -- npm run pretest && npm run coverage -after_script: -- greenkeeper-lockfile-upload -- bash <(curl -s https://codecov.io/bash) -jobs: - allow_failures: - - env: NODE_VERSION=12.12.0 - include: - - stage: - addons: - postgresql: '11' - apt: - packages: - - postgresql-11-postgis-3 - - postgresql-11-postgis-3-scripts - env: POSTGRES_MAJOR_VERSION=11 PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://localhost:5433/parse_server_postgres_adapter_test_database - before_install: bash scripts/before_install_postgres.sh - before_script: bash scripts/before_script_postgres.sh - script: - - npm run lint - - npm run coverage - - stage: release - node_js: '10' - env: - before_script: skip - after_script: skip - script: - - "./release_docs.sh" - deploy: - - provider: pages - skip_cleanup: true - token: - secure: YU2lUqmW036AHBRu7xO/AwEeQ900Q/5O6FL96ZqWEfD7Gadaq4iapkNvhPR0HcZYRHqQV2/2LCHVnhd0dbj0ShkmVIHdQE7O+MF+j0v0GIVc8FPTPe1/d2Hy4apSWNe6FeCrYKVeliAu+ZqvNuFLhVmYvIeJdlJrMGOb6P76UZXRDv2srXhq4uBcCVUJuTajyyd5ttJfcNapymTP+xzEDYc7Hr4LJaubmv/wVD/xwPBbvfYFuBqysUpkPKi/ODlQbB0ybYh2fFnX71WUyFUGbtB5xI9ma951Zp4v3t73c31uUl27dJaHzO62EtVTdcUKAa804EtAtsvpeJWMVWKUgigm9UZcXdEwKa79fl5nLaq34lrSktAYOkexwPqYj+vbS6sn52JrluSxLE+4cEke7tYbnJ9X12SAQXKgcXY3n30+6gKf9RVqYdlNsYpEAqKVIDb6SlEkk86dP+uIg/XXb5RKEwxbDXnb6xdl9JRc+GTbeeY3/vg2h9QTdmFVblPtBhHrNenQYP/BS0n+EfUnAIBKqRmQgyhao3SiY5FMACM8higI2Lvvhpq46pDhXqsexYCz5F008C6YXGDh5gC93rJFec0pjh55DNdQu6uw3YMQ5jtf3QUXoPAoMFud3cTulMlnjC1WZG8QbqER8dzUZ4TcaQUdzribJI/mRriheBg= - local_dir: docs/ - on: - all_branches: true - - provider: npm - skip_cleanup: true - api_token: - secure: Yrng6jsnMAtzrrln9DwRuY4xpcxl/WYS/1A5fckyQF6DsLmNlvqVtu3MWF+zdJgANF63G3jIee11tNBpYRecHl8FjPGwO0kc1vEgvIRVnveyR0bwIIDH6s/mR9dg4rZikflwG4XExsLyaQd7ko8aTIOIayfxJiv/u0yqwuBuBW2bFrL/41b1cKGK5+Iq2a+PdFENUPenKXISkACGaMnQF4Y/KVF98UwCiGLf957yFWc2sD6TFbjNDbAENSccvg1J3fBb+djbtzKzldl29ntp2mKVGSVASiKCRa6hSfgQulHiidFqFIKgpYJ1uATRr3UFr/NRVt1WbrgLnzY74OCX7y02c/xiYQMMEPRl/P8hHJu+KjQ3PBWsBvmsRN0QMUJv3PEjUPE3AY8sw49NoxiJZzJr7574vUBuM/dk0byYI6K/gwmUrPIhQjljzZqinS8JJJ4FjGjCdzXRhT5Q+PZvt5bF1rMOZXayNJZa+cICtmiJoU3vO2Yf6TXC3wY1veKvmcs24nws5lp4keJePTKAi1Ig7VoSxwAlgs3EGANIh7oBKx9zWnXQYMdmxbYsvLXAWcnnM+PcSCvooLmXWso3BQBeRuUUSS2oLaBpsFMsiniLNbA1cW4fwMkgUGz4oEDRi8wTD89E/1J2oNxzqtWRPawcVKpMpnBbDJHrWJPEHMw= - email: - secure: lomzDl71N995SzRczm7VE9OZE+PzMo4X8t3zU97agu/FMH5Qcj8BLwE+uVDTnA9Vblyj62ZsFKsNjP2Qp53Vcd+jHM4EJNWNRZYpEMIRO3LngX43r83qoFEHUvPu9s1oaa04a6FojcsJx0wl6B6Ke2AX74MXnJDLb9iZBy1mkpLUMVccVhSfhdoIzhkq3dhUw+6d8C024tNMHcgDW3VnRAsWFtiL7dCMpjLOdI+UxlkeGkQkxXXuRsZ0ZdjoSoM8NSkiYMc8x6EnekyRDoHTujX3OFxuU6+GAjrUmVzNmJWrBIqHVb0DXBQxjEaG3d/cNu5UsQyZYq5sxRRH0BaLs7F4oIQg95etasEtTtUkmsZ3pshVlsweiLU366UdbfuAf5hrJjqLrU12BKZyLjaAwyeKz031r8dA4sJtGIp5uVdXobQQTH6r958A88byJ20uaYSqhqjhZo3hkWXIQP0WQN2Ej/g57HbVNLB/nPKkMILfk/tpp7nBDLT0QrjbZxeo1dwCHqsBEV6z7ZyWyFf4xwpDsir4txL4t8ElzeGdlACjCqAJvIh5w9YzfrwijtoVMvvP6pWvn/iI640d4rsdIDe8egxgqZ1R/TMd/tdHYX+eI+ZfFmCVGj36/uXwdG7KIoIZVjRQ2tvWr9ZuydEPWPSRVGT4ycFeu6wbm3elM3I= - on: - tags: true - all_branches: true - repo: parse-community/parse-server diff --git a/README.md b/README.md index b500230c13..c3720c4138 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@
-
+
+
+
diff --git a/scripts/before_install_postgres.sh b/scripts/before_install_postgres.sh
deleted file mode 100755
index 648fd95fc5..0000000000
--- a/scripts/before_install_postgres.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-set -e
-source ~/.nvm/nvm.sh
-
-echo "[SCRIPT] Before Install Script :: Setup Postgres ${POSTGRES_MAJOR_VERSION}"
-
-nvm install $NODE_VERSION
-nvm use $NODE_VERSION
-npm install -g greenkeeper-lockfile@1
-
-if [[ $POSTGRES_MAJOR_VERSION -lt 11 ]]; then
- # Setup postgres 9 or 10
- sudo sed -i 's/port = 5432/port = 5433/' /etc/postgresql/${POSTGRES_MAJOR_VERSION}/main/postgresql.conf
-
- # Stop the current running service
- sudo service postgresql stop
-
- # Remove correct version of postgres
- if [[ $POSTGRES_MAJOR_VERSION -lt 10 ]]; then
- sudo apt-get remove -q 'postgresql-10.*'
- else
- sudo apt-get remove -q 'postgresql-9.*'
- fi
-
- sudo service postgresql start
-
-else
- # Setup postgres 11 or higher
-
- #Copy defauilt hba config file and tell postgres to restart
- sudo cp /etc/postgresql/{10,${POSTGRES_MAJOR_VERSION}}/main/pg_hba.conf
- sudo systemctl restart postgresql@${POSTGRES_MAJOR_VERSION}-main
-fi
diff --git a/scripts/before_script_postgres.sh b/scripts/before_script_postgres.sh
index 5699f51e93..13951b998b 100755
--- a/scripts/before_script_postgres.sh
+++ b/scripts/before_script_postgres.sh
@@ -4,10 +4,7 @@ set -e
echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres ${POSTGRES_MAJOR_VERSION}"
-node -e 'require("./lib/index.js")'
-greenkeeper-lockfile-update
-
-psql -v ON_ERROR_STOP=1 -p 5433 --username "postgres" --dbname "${POSTGRES_DB}" <<-EOSQL
+PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
CREATE DATABASE parse_server_postgres_adapter_test_database;
\c parse_server_postgres_adapter_test_database;
CREATE EXTENSION postgis;
diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js
index 0a672db17e..2d660df99e 100644
--- a/spec/CloudCode.spec.js
+++ b/spec/CloudCode.spec.js
@@ -1633,9 +1633,8 @@ describe('Cloud Code', () => {
it('should set the message / success on the job', done => {
Parse.Cloud.job('myJob', req => {
- req.message('hello');
const promise = req
- .message()
+ .message('hello')
.then(() => {
return getJobStatus(req.jobId);
})
@@ -1716,9 +1715,15 @@ describe('Cloud Code', () => {
throw new Parse.Error(101, 'Something went wrong');
});
const job = await Parse.Cloud.startJob('myJobError');
- const jobStatus = await Parse.Cloud.getJobStatus(job);
+ let jobStatus, status;
+ while (status !== 'failed') {
+ if (jobStatus) {
+ await new Promise(resolve => setTimeout(resolve, 10));
+ }
+ jobStatus = await Parse.Cloud.getJobStatus(job);
+ status = jobStatus.get('status');
+ }
expect(jobStatus.get('message')).toEqual('Something went wrong');
- expect(jobStatus.get('status')).toEqual('failed');
});
function getJobStatus(jobId) {