From 886a90d1fdfac42747c9e79eb955bc9775d62905 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 26 Sep 2022 10:40:37 +0100 Subject: [PATCH] only run in test mode if couch url is not passed --- .github/workflows/budibase_ci.yml | 20 ++++++++++---------- packages/server/src/db/index.js | 10 +++++----- packages/worker/src/db/index.js | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index fa99a3d89b..475bd4f66a 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -51,16 +51,16 @@ jobs: - run: yarn bootstrap - run: yarn lint - run: yarn build - # - run: yarn test - # env: - # CI: true - # name: Budibase CI - # - uses: codecov/codecov-action@v1 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - # files: ./packages/server/coverage/clover.xml - # name: codecov-umbrella - # verbose: true + - run: yarn test + env: + CI: true + name: Budibase CI + - uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./packages/server/coverage/clover.xml + name: codecov-umbrella + verbose: true - name: QA Core Integration Tests run: | diff --git a/packages/server/src/db/index.js b/packages/server/src/db/index.js index e8ec2c720e..381c295d18 100644 --- a/packages/server/src/db/index.js +++ b/packages/server/src/db/index.js @@ -1,5 +1,5 @@ const core = require("@budibase/backend-core") -// const env = require("../environment") +const env = require("../environment") exports.init = () => { const dbConfig = { @@ -7,10 +7,10 @@ exports.init = () => { find: true, } - // if (env.isTest()) { - // dbConfig.inMemory = true - // dbConfig.allDbs = true - // } + if (env.isTest() && !env.COUCH_DB_URL) { + dbConfig.inMemory = true + dbConfig.allDbs = true + } core.init({ db: dbConfig }) } diff --git a/packages/worker/src/db/index.js b/packages/worker/src/db/index.js index bdfc55a22a..58fd8484ff 100644 --- a/packages/worker/src/db/index.js +++ b/packages/worker/src/db/index.js @@ -1,11 +1,11 @@ const core = require("@budibase/backend-core") -// const env = require("../environment") +const env = require("../environment") exports.init = () => { const dbConfig = {} - // if (env.isTest()) { - // dbConfig.inMemory = true - // dbConfig.allDbs = true - // } + if (env.isTest() && !env.COUCH_DB_URL) { + dbConfig.inMemory = true + dbConfig.allDbs = true + } core.init({ db: dbConfig }) }