Skip to content

Commit 2a27f22

Browse files
espyjanl
authored andcommitted
ci: avoid using pouchdb-server in testing
Destroying databases is flaky in pouchdb-server
1 parent bec973e commit 2a27f22

1 file changed

Lines changed: 75 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,28 @@ jobs:
174174
- TYPE=find PLUGINS=pouchdb-find npm test
175175
- TYPE=mapreduce npm test
176176
runs-on: ubuntu-latest
177+
services:
178+
couchdb:
179+
image: couchdb:3.1
180+
ports:
181+
- 5984:5984
182+
env:
183+
COUCHDB_USER: admin
184+
COUCHDB_PASSWORD: password
177185
env:
178186
CLIENT: node
187+
SERVER: couchdb-master
188+
COUCH_HOST: http://admin:password@127.0.0.1:5984
189+
SKIP_MIGRATION: 1
179190
ADAPTERS: ${{ matrix.adapter }}
180191
steps:
181192
- uses: actions/checkout@v4
182193
with:
183194
persist-credentials: false
195+
- name: Wait for CouchDB
196+
run: ./bin/wait-for-couch.sh 20
197+
- name: Setup CouchDB CORS
198+
run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"'
184199
- uses: ./.github/actions/install-node-package
185200
with:
186201
node-version: ${{ matrix.node }}
@@ -213,14 +228,29 @@ jobs:
213228
- TYPE=find PLUGINS=pouchdb-find npm test
214229
- TYPE=mapreduce npm test
215230
runs-on: ubuntu-latest
231+
services:
232+
couchdb:
233+
image: couchdb:3.1
234+
ports:
235+
- 5984:5984
236+
env:
237+
COUCHDB_USER: admin
238+
COUCHDB_PASSWORD: password
216239
env:
240+
SERVER: couchdb-master
241+
COUCH_HOST: http://admin:password@127.0.0.1:5984
242+
SKIP_MIGRATION: 1
217243
USE_MINIFIED: 1
218244
CLIENT: ${{ matrix.client }}
219245
ADAPTERS: ${{ matrix.adapter }}
220246
steps:
221247
- uses: actions/checkout@v4
222248
with:
223249
persist-credentials: false
250+
- name: Wait for CouchDB
251+
run: ./bin/wait-for-couch.sh 20
252+
- name: Setup CouchDB CORS
253+
run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"'
224254
- uses: ./.github/actions/install-node-package
225255
with:
226256
node-version: ${{ env.NODE_VERSION }}
@@ -247,14 +277,57 @@ jobs:
247277
matrix:
248278
node: [20, 22]
249279
cmd:
250-
- CLIENT=firefox npm run test-webpack
280+
- COUCH_HOST=http://admin:password@127.0.0.1:5984 CLIENT=firefox npm run test-webpack
251281
- AUTO_COMPACTION=true npm test
252-
- TYPE=performance npm test
253282
- npm run test-unit
254283
- npm run test-component
255284
- npm run test-fuzzy
256285
- npm run verify-build
257286
runs-on: ubuntu-latest
287+
env:
288+
SERVER: couchdb-master
289+
COUCH_HOST: http://admin:password@127.0.0.1:5984
290+
services:
291+
couchdb:
292+
image: couchdb:3.1
293+
ports:
294+
- 5984:5984
295+
env:
296+
COUCHDB_USER: admin
297+
COUCHDB_PASSWORD: password
298+
steps:
299+
- uses: actions/checkout@v4
300+
with:
301+
persist-credentials: false
302+
- name: Wait for CouchDB
303+
run: ./bin/wait-for-couch.sh 20
304+
- name: Setup CouchDB CORS
305+
run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"'
306+
- uses: ./.github/actions/install-node-package
307+
with:
308+
node-version: ${{ matrix.node }}
309+
- uses: ./.github/actions/build-pouchdb
310+
- id: test
311+
run: ${{ matrix.cmd }}
312+
continue-on-error: true
313+
- name: First retry
314+
id: retry
315+
if: steps.test.outcome == 'failure'
316+
run: git reset --hard && ${{ matrix.cmd }}
317+
continue-on-error: true
318+
- name: Second retry
319+
if: steps.retry.outcome == 'failure'
320+
run: git reset --hard && ${{ matrix.cmd }}
321+
322+
nodejs-perf:
323+
needs: lint
324+
strategy:
325+
fail-fast: false
326+
matrix:
327+
node: [20, 22]
328+
cmd:
329+
- TYPE=performance npm test
330+
runs-on: ubuntu-latest
258331
steps:
259332
- uses: actions/checkout@v4
260333
with:

0 commit comments

Comments
 (0)