mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-20 08:37:53 +02:00
UBERF-6202: Use only one mongo pull per configuration (#5073)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -44,9 +44,8 @@ import {
|
||||
DummyFullTextAdapter,
|
||||
type FullTextAdapter
|
||||
} from '@hcengineering/server-core'
|
||||
import { type MongoClient } from 'mongodb'
|
||||
import { createMongoAdapter, createMongoTxAdapter } from '..'
|
||||
import { getMongoClient, shutdown } from '../utils'
|
||||
import { getMongoClient, type MongoClientReference, shutdown } from '../utils'
|
||||
import { genMinModel } from './minmodel'
|
||||
import { createTaskModel, type Task, type TaskComment, taskPlugin } from './tasks'
|
||||
|
||||
@@ -80,7 +79,7 @@ async function createNullContentTextAdapter (): Promise<ContentTextAdapter> {
|
||||
|
||||
describe('mongo operations', () => {
|
||||
const mongodbUri: string = process.env.MONGO_URL ?? 'mongodb://localhost:27017'
|
||||
let mongoClient!: MongoClient
|
||||
let mongoClient!: MongoClientReference
|
||||
let dbId: string = generateId()
|
||||
let hierarchy: Hierarchy
|
||||
let model: ModelDb
|
||||
@@ -88,7 +87,7 @@ describe('mongo operations', () => {
|
||||
let operations: TxOperations
|
||||
|
||||
beforeAll(async () => {
|
||||
mongoClient = await getMongoClient(mongodbUri)
|
||||
mongoClient = getMongoClient(mongodbUri)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -101,7 +100,7 @@ describe('mongo operations', () => {
|
||||
|
||||
afterEach(async () => {
|
||||
try {
|
||||
await mongoClient.db(dbId).dropDatabase()
|
||||
await (await mongoClient.getClient()).db(dbId).dropDatabase()
|
||||
} catch (eee) {}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user