fix minio test provider
This commit is contained in:
parent
e1400d26d0
commit
5b3cb06365
|
@ -11,7 +11,7 @@ class ObjectStoreWaitStrategy extends AbstractWaitStrategy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function start() {
|
export async function start(): Promise<{ host: string; port: number }> {
|
||||||
container = await new GenericContainer("minio/minio")
|
container = await new GenericContainer("minio/minio")
|
||||||
.withExposedPorts(9000)
|
.withExposedPorts(9000)
|
||||||
.withCommand(["server", "/data"])
|
.withCommand(["server", "/data"])
|
||||||
|
@ -24,7 +24,8 @@ export async function start() {
|
||||||
|
|
||||||
const host = container.getHost()
|
const host = container.getHost()
|
||||||
const port = container.getMappedPort(9000)
|
const port = container.getMappedPort(9000)
|
||||||
env._set("MINIO_URL", `http:/${host}:${port}`)
|
env._set("MINIO_URL", `http://0.0.0.0:${port}`)
|
||||||
|
return { host, port }
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function stop() {
|
export async function stop() {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Datasource } from "@budibase/types"
|
||||||
import * as postgres from "./postgres"
|
import * as postgres from "./postgres"
|
||||||
import * as mongodb from "./mongodb"
|
import * as mongodb from "./mongodb"
|
||||||
import * as mysql from "./mysql"
|
import * as mysql from "./mysql"
|
||||||
import * as minio from "./minio"
|
|
||||||
import * as mssql from "./mssql"
|
import * as mssql from "./mssql"
|
||||||
import * as mariadb from "./mariadb"
|
import * as mariadb from "./mariadb"
|
||||||
import { StartedTestContainer } from "testcontainers"
|
import { StartedTestContainer } from "testcontainers"
|
||||||
|
@ -17,7 +16,6 @@ export interface DatabaseProvider {
|
||||||
datasource(): Promise<Datasource>
|
datasource(): Promise<Datasource>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const objectStoreTestProviders = { minio }
|
|
||||||
export const databaseTestProviders = {
|
export const databaseTestProviders = {
|
||||||
postgres,
|
postgres,
|
||||||
mongodb,
|
mongodb,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
jest.unmock("node-fetch")
|
jest.unmock("node-fetch")
|
||||||
|
jest.unmock("aws-sdk")
|
||||||
import { TestConfiguration } from "../../../../tests"
|
import { TestConfiguration } from "../../../../tests"
|
||||||
import { EmailTemplatePurpose } from "../../../../constants"
|
import { EmailTemplatePurpose } from "../../../../constants"
|
||||||
import { objectStoreTestProviders, mocks } from "@budibase/backend-core/tests"
|
import { objectStoreTestProviders, mocks } from "@budibase/backend-core/tests"
|
||||||
import { objectStore } from "@budibase/backend-core"
|
import { objectStore } from "@budibase/backend-core"
|
||||||
import env from "../../../../environment"
|
|
||||||
import tk from "timekeeper"
|
import tk from "timekeeper"
|
||||||
jest.unmock("aws-sdk")
|
|
||||||
const nodemailer = require("nodemailer")
|
const nodemailer = require("nodemailer")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue