Fix tests to use connection string instead of env
This commit is contained in:
parent
209ada0c38
commit
5456866c45
|
@ -4,21 +4,21 @@ export const getCouchInfo = (connection?: string) => {
|
||||||
const urlInfo = getUrlInfo(connection)
|
const urlInfo = getUrlInfo(connection)
|
||||||
let username
|
let username
|
||||||
let password
|
let password
|
||||||
if (env.COUCH_DB_USERNAME) {
|
if (urlInfo.auth?.username) {
|
||||||
// set from env
|
|
||||||
username = env.COUCH_DB_USERNAME
|
|
||||||
} else if (urlInfo.auth.username) {
|
|
||||||
// set from url
|
// set from url
|
||||||
username = urlInfo.auth.username
|
username = urlInfo.auth.username
|
||||||
|
} else if (env.COUCH_DB_USERNAME) {
|
||||||
|
// set from env
|
||||||
|
username = env.COUCH_DB_USERNAME
|
||||||
} else if (!env.isTest()) {
|
} else if (!env.isTest()) {
|
||||||
throw new Error("CouchDB username not set")
|
throw new Error("CouchDB username not set")
|
||||||
}
|
}
|
||||||
if (env.COUCH_DB_PASSWORD) {
|
if (urlInfo.auth?.password) {
|
||||||
// set from env
|
|
||||||
password = env.COUCH_DB_PASSWORD
|
|
||||||
} else if (urlInfo.auth.password) {
|
|
||||||
// set from url
|
// set from url
|
||||||
password = urlInfo.auth.password
|
password = urlInfo.auth.password
|
||||||
|
} else if (env.COUCH_DB_PASSWORD) {
|
||||||
|
// set from env
|
||||||
|
password = env.COUCH_DB_PASSWORD
|
||||||
} else if (!env.isTest()) {
|
} else if (!env.isTest()) {
|
||||||
throw new Error("CouchDB password not set")
|
throw new Error("CouchDB password not set")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { GenericContainer } from "testcontainers"
|
import { GenericContainer } from "testcontainers"
|
||||||
import postgres from "../../../../packages/server/src/integrations/postgres"
|
import postgres from "../../../../packages/server/src/integrations/postgres"
|
||||||
|
|
||||||
|
import { generator } from "@budibase/backend-core/tests"
|
||||||
|
|
||||||
jest.unmock("pg")
|
jest.unmock("pg")
|
||||||
|
|
||||||
describe("datasource validators", () => {
|
describe("datasource validators", () => {
|
||||||
|
|
Loading…
Reference in New Issue