Skip to content

Commit 2610259

Browse files
committed
Try dynamic replicaset name
1 parent db4d04b commit 2610259

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/build-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: "Create MongoDB Atlas Local"
6060
if: ${{ matrix.mongodb == 'Atlas' }}
6161
run: |
62-
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest
62+
docker run --name mongodb -p 27017:27017 --detach mongodb/mongodb-atlas-local:latest
6363
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
6464
sleep 1
6565
done
@@ -97,10 +97,10 @@ jobs:
9797

9898
- name: "Install dependencies"
9999
run: |
100+
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
101+
export MONGODB_URI="mongodb://127.0.0.1:27017/?replicaSet=$($MONGOSH_BIN '127.0.0.1:27017' --eval 'rs.status().set')"
100102
composer update --no-interaction \
101103
$([[ "${{ matrix.mode }}" == low-deps ]] && echo ' --prefer-lowest') \
102104
$([[ "${{ matrix.mode }}" == ignore-php-req ]] && echo ' --ignore-platform-req=php+')
103105
- name: "Run tests"
104106
run: "./vendor/bin/phpunit --coverage-clover coverage.xml"
105-
env:
106-
MONGODB_URI: 'mongodb://127.0.0.1/'

0 commit comments

Comments
 (0)