Skip to content

Commit 53efa2f

Browse files
committed
await the server
1 parent 47f681d commit 53efa2f

File tree

2 files changed

+93
-102
lines changed

2 files changed

+93
-102
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -151,31 +151,31 @@ jobs:
151151
strategy:
152152
matrix:
153153
include:
154-
# - name: MongoDB 6, ReplicaSet
155-
# MONGODB_VERSION: 6.0.19
156-
# MONGODB_TOPOLOGY: replset
157-
# NODE_VERSION: 22.12.0
158-
# - name: MongoDB 7, ReplicaSet
159-
# MONGODB_VERSION: 7.0.16
160-
# MONGODB_TOPOLOGY: replset
161-
# NODE_VERSION: 22.12.0
162-
# - name: MongoDB 8, ReplicaSet
163-
# MONGODB_VERSION: 8.0.4
164-
# MONGODB_TOPOLOGY: replset
165-
# NODE_VERSION: 22.12.0
154+
- name: MongoDB 6, ReplicaSet
155+
MONGODB_VERSION: 6.0.19
156+
MONGODB_TOPOLOGY: replset
157+
NODE_VERSION: 22.12.0
158+
- name: MongoDB 7, ReplicaSet
159+
MONGODB_VERSION: 7.0.16
160+
MONGODB_TOPOLOGY: replset
161+
NODE_VERSION: 22.12.0
162+
- name: MongoDB 8, ReplicaSet
163+
MONGODB_VERSION: 8.0.4
164+
MONGODB_TOPOLOGY: replset
165+
NODE_VERSION: 22.12.0
166166
- name: Redis Cache
167167
PARSE_SERVER_TEST_CACHE: redis
168168
MONGODB_VERSION: 8.0.4
169169
MONGODB_TOPOLOGY: standalone
170170
NODE_VERSION: 22.12.0
171-
# - name: Node 20
172-
# MONGODB_VERSION: 8.0.4
173-
# MONGODB_TOPOLOGY: standalone
174-
# NODE_VERSION: 20.18.0
175-
# - name: Node 18
176-
# MONGODB_VERSION: 8.0.4
177-
# MONGODB_TOPOLOGY: standalone
178-
# NODE_VERSION: 18.20.4
171+
- name: Node 20
172+
MONGODB_VERSION: 8.0.4
173+
MONGODB_TOPOLOGY: standalone
174+
NODE_VERSION: 20.18.0
175+
- name: Node 18
176+
MONGODB_VERSION: 8.0.4
177+
MONGODB_TOPOLOGY: standalone
178+
NODE_VERSION: 18.20.4
179179
fail-fast: false
180180
name: ${{ matrix.name }}
181181
timeout-minutes: 20
@@ -218,77 +218,77 @@ jobs:
218218
# Set to `true` once codecov token bug is fixed; https://github.com/parse-community/parse-server/issues/9129
219219
fail_ci_if_error: false
220220
token: ${{ secrets.CODECOV_TOKEN }}
221-
# check-postgres:
222-
# strategy:
223-
# matrix:
224-
# include:
225-
# - name: PostgreSQL 15, PostGIS 3.3
226-
# POSTGRES_IMAGE: postgis/postgis:15-3.3
227-
# NODE_VERSION: 22.12.0
228-
# - name: PostgreSQL 15, PostGIS 3.4
229-
# POSTGRES_IMAGE: postgis/postgis:15-3.4
230-
# NODE_VERSION: 22.12.0
231-
# - name: PostgreSQL 15, PostGIS 3.5
232-
# POSTGRES_IMAGE: postgis/postgis:15-3.5
233-
# NODE_VERSION: 22.12.0
234-
# - name: PostgreSQL 16, PostGIS 3.5
235-
# POSTGRES_IMAGE: postgis/postgis:16-3.5
236-
# NODE_VERSION: 22.12.0
237-
# - name: PostgreSQL 17, PostGIS 3.5
238-
# POSTGRES_IMAGE: postgis/postgis:17-3.5
239-
# NODE_VERSION: 22.12.0
240-
# fail-fast: false
241-
# name: ${{ matrix.name }}
242-
# timeout-minutes: 20
243-
# runs-on: ubuntu-latest
244-
# services:
245-
# redis:
246-
# image: redis
247-
# ports:
248-
# - 6379:6379
249-
# postgres:
250-
# image: ${{ matrix.POSTGRES_IMAGE }}
251-
# env:
252-
# POSTGRES_PASSWORD: postgres
253-
# ports:
254-
# - 5432:5432
255-
# options: >-
256-
# --health-cmd pg_isready
257-
# --health-interval 10s
258-
# --health-timeout 5s
259-
# --health-retries 5
260-
# env:
261-
# PARSE_SERVER_TEST_DB: postgres
262-
# PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
263-
# NODE_VERSION: ${{ matrix.NODE_VERSION }}
264-
# steps:
265-
# - uses: actions/checkout@v4
266-
# - name: Use Node.js ${{ matrix.NODE_VERSION }}
267-
# uses: actions/setup-node@v4
268-
# with:
269-
# node-version: ${{ matrix.NODE_VERSION }}
270-
# - name: Cache Node.js modules
271-
# uses: actions/cache@v4
272-
# with:
273-
# path: ~/.npm
274-
# key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
275-
# restore-keys: |
276-
# ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
277-
# - name: Install dependencies
278-
# run: npm ci
279-
# - run: |
280-
# bash scripts/before_script_postgres_conf.sh
281-
# bash scripts/before_script_postgres.sh
282-
# - run: npm run coverage
283-
# env:
284-
# CI: true
285-
# - name: Upload code coverage
286-
# uses: codecov/codecov-action@v4
287-
# with:
288-
# fail_ci_if_error: false
289-
# token: ${{ secrets.CODECOV_TOKEN }}
290-
# env:
291-
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
221+
check-postgres:
222+
strategy:
223+
matrix:
224+
include:
225+
- name: PostgreSQL 15, PostGIS 3.3
226+
POSTGRES_IMAGE: postgis/postgis:15-3.3
227+
NODE_VERSION: 22.12.0
228+
- name: PostgreSQL 15, PostGIS 3.4
229+
POSTGRES_IMAGE: postgis/postgis:15-3.4
230+
NODE_VERSION: 22.12.0
231+
- name: PostgreSQL 15, PostGIS 3.5
232+
POSTGRES_IMAGE: postgis/postgis:15-3.5
233+
NODE_VERSION: 22.12.0
234+
- name: PostgreSQL 16, PostGIS 3.5
235+
POSTGRES_IMAGE: postgis/postgis:16-3.5
236+
NODE_VERSION: 22.12.0
237+
- name: PostgreSQL 17, PostGIS 3.5
238+
POSTGRES_IMAGE: postgis/postgis:17-3.5
239+
NODE_VERSION: 22.12.0
240+
fail-fast: false
241+
name: ${{ matrix.name }}
242+
timeout-minutes: 20
243+
runs-on: ubuntu-latest
244+
services:
245+
redis:
246+
image: redis
247+
ports:
248+
- 6379:6379
249+
postgres:
250+
image: ${{ matrix.POSTGRES_IMAGE }}
251+
env:
252+
POSTGRES_PASSWORD: postgres
253+
ports:
254+
- 5432:5432
255+
options: >-
256+
--health-cmd pg_isready
257+
--health-interval 10s
258+
--health-timeout 5s
259+
--health-retries 5
260+
env:
261+
PARSE_SERVER_TEST_DB: postgres
262+
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
263+
NODE_VERSION: ${{ matrix.NODE_VERSION }}
264+
steps:
265+
- uses: actions/checkout@v4
266+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
267+
uses: actions/setup-node@v4
268+
with:
269+
node-version: ${{ matrix.NODE_VERSION }}
270+
- name: Cache Node.js modules
271+
uses: actions/cache@v4
272+
with:
273+
path: ~/.npm
274+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
275+
restore-keys: |
276+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
277+
- name: Install dependencies
278+
run: npm ci
279+
- run: |
280+
bash scripts/before_script_postgres_conf.sh
281+
bash scripts/before_script_postgres.sh
282+
- run: npm run coverage
283+
env:
284+
CI: true
285+
- name: Upload code coverage
286+
uses: codecov/codecov-action@v4
287+
with:
288+
fail_ci_if_error: false
289+
token: ${{ secrets.CODECOV_TOKEN }}
290+
env:
291+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
292292
concurrency:
293293
group: ${{ github.workflow }}-${{ github.ref }}
294294
cancel-in-progress: true

spec/helper.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,12 @@ let didChangeConfiguration = false;
161161
const openConnections = new Connections();
162162

163163
const shutdownServer = async (_parseServer) => {
164-
_parseServer.handleShutdown();
164+
await _parseServer.handleShutdown();
165165
// Connection close events are not immediate on node 10+, so wait a bit
166166
await sleep(100);
167167
// Jasmine process counts as one open connection
168168
const connectionMessage = `There were ${openConnections.count()} open connections to the server left after the test finished`;
169-
if (process.env.PARSE_SERVER_TEST_CACHE === 'redis') {
170-
if (openConnections.count() > 1) {
171-
console.log(connectionMessage);
172-
// const count = await getConnectionsCount(_parseServer.server);
173-
const count = 0;
174-
expect(openConnections.count() > 1).toBeFalsy(`${connectionMessage} but there are ${count} connections in the server`);
175-
}
176-
} else {
177-
expect(openConnections.count() > 1).toBeFalsy(connectionMessage);
178-
}
169+
expect(openConnections.count() > 1).toBeFalsy(connectionMessage);
179170
parseServer = undefined;
180171
};
181172

0 commit comments

Comments
 (0)