From aa8db759d380ba58ac90304c786b3eba5004b1bd Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Mon, 29 Jun 2020 23:20:45 +0200 Subject: [PATCH] use different db connection on gh actions --- .github/workflows/test.yml | 15 +++++++++++++++ config.json.example | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eab27e214a..98f8f1d3cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,6 +111,11 @@ jobs: matrix: node-version: [12.x] mongodb-version: [4.2] + env: + # The test database connection uri is specified here and not taken from + # config.json.example because it differs between local installs and + # github actions, because the github action replica set only has 1 member + TEST_DB_URI=mongodb://localhost:27017/habitica-test?replicaSet=habitica-test-rs steps: - uses: actions/checkout@v1 with: @@ -139,6 +144,11 @@ jobs: matrix: node-version: [12.x] mongodb-version: [4.2] + env: + # The test database connection uri is specified here and not taken from + # config.json.example because it differs between local installs and + # github actions, because the github action replica set only has 1 member + TEST_DB_URI=mongodb://localhost:27017/habitica-test?replicaSet=habitica-test-rs steps: - uses: actions/checkout@v1 with: @@ -167,6 +177,11 @@ jobs: matrix: node-version: [12.x] mongodb-version: [4.2] + env: + # The test database connection uri is specified here and not taken from + # config.json.example because it differs between local installs and + # github actions, because the github action replica set only has 1 member + TEST_DB_URI=mongodb://localhost:27017/habitica-test?replicaSet=habitica-test-rs steps: - uses: actions/checkout@v1 with: diff --git a/config.json.example b/config.json.example index 6a043e3b87..c67a5846e1 100644 --- a/config.json.example +++ b/config.json.example @@ -32,7 +32,8 @@ "LOGGLY_SUBDOMAIN": "example-subdomain", "LOGGLY_TOKEN": "example-token", "MAINTENANCE_MODE": "false", - "NODE_DB_URI": "mongodb://localhost:27017/habitrpg", + "NODE_DB_URI": "mongodb://localhost:27017,localhost:27018,localhost:27019/habitica-dev?replicaSet=rs", + "TEST_DB_URI": "mongodb://localhost:27017,localhost:27018,localhost:27019/habitica-dev?replicaSet=rs", "MONGODB_POOL_SIZE": "10", "NODE_ENV": "development", "PATH": "bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin", @@ -70,7 +71,6 @@ "SLACK_URL": "https://hooks.slack.com/services/some-url", "STRIPE_API_KEY": "aaaabbbbccccddddeeeeffff00001111", "STRIPE_PUB_KEY": "22223333444455556666777788889999", - "TEST_DB_URI": "mongodb://localhost:27017/habitica-test?replicaSet=habitica-test-rs", "TRANSIFEX_SLACK_CHANNEL": "transifex", "WEB_CONCURRENCY": 1, "SKIP_SSL_CHECK_KEY": "key",