fix minio test provider

This commit is contained in:
Peter Clement 2024-03-25 16:13:55 +00:00
parent e1400d26d0
commit 5b3cb06365
3 changed files with 4 additions and 6 deletions

View File

@ -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")
.withExposedPorts(9000)
.withCommand(["server", "/data"])
@ -24,7 +24,8 @@ export async function start() {
const host = container.getHost()
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() {

View File

@ -4,7 +4,6 @@ import { Datasource } from "@budibase/types"
import * as postgres from "./postgres"
import * as mongodb from "./mongodb"
import * as mysql from "./mysql"
import * as minio from "./minio"
import * as mssql from "./mssql"
import * as mariadb from "./mariadb"
import { StartedTestContainer } from "testcontainers"
@ -17,7 +16,6 @@ export interface DatabaseProvider {
datasource(): Promise<Datasource>
}
export const objectStoreTestProviders = { minio }
export const databaseTestProviders = {
postgres,
mongodb,

View File

@ -1,11 +1,10 @@
jest.unmock("node-fetch")
jest.unmock("aws-sdk")
import { TestConfiguration } from "../../../../tests"
import { EmailTemplatePurpose } from "../../../../constants"
import { objectStoreTestProviders, mocks } from "@budibase/backend-core/tests"
import { objectStore } from "@budibase/backend-core"
import env from "../../../../environment"
import tk from "timekeeper"
jest.unmock("aws-sdk")
const nodemailer = require("nodemailer")
const fetch = require("node-fetch")