From 90c9138034978592a5551ff86b69559efe3679fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 2 Jan 2025 23:43:52 +0100 Subject: [PATCH] Try dynamic replicaset name --- .github/workflows/build-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 3a84d3f91..7a987d251 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -59,7 +59,7 @@ jobs: - name: "Create MongoDB Atlas Local" if: ${{ matrix.mongodb == 'Atlas' }} run: | - docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest + docker run --name mongodb -p 27017:27017 --detach mongodb/mongodb-atlas-local:latest until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do sleep 1 done @@ -101,6 +101,10 @@ jobs: $([[ "${{ matrix.mode }}" == low-deps ]] && echo ' --prefer-lowest') \ $([[ "${{ matrix.mode }}" == ignore-php-req ]] && echo ' --ignore-platform-req=php+') - name: "Run tests" - run: "./vendor/bin/phpunit --coverage-clover coverage.xml" - env: - MONGODB_URI: 'mongodb://127.0.0.1/' + run: | + if [ "${{ matrix.mongodb }}" = "Atlas" ]; then + export MONGODB_URI="mongodb://127.0.0.1:27017/" + else + export MONGODB_URI="mongodb://127.0.0.1:27017/?replicaSet=rs" + fi + ./vendor/bin/phpunit --coverage-clover coverage.xml