mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
test(server): align integration stubs with new config + pg-extension injection
This commit is contained in:
@@ -16,6 +16,7 @@ import { KyselyDB } from '@docmost/db/types/kysely.types';
|
|||||||
import { BaseQueryCacheService } from './base-query-cache.service';
|
import { BaseQueryCacheService } from './base-query-cache.service';
|
||||||
import { QueryCacheConfigProvider } from './query-cache.config';
|
import { QueryCacheConfigProvider } from './query-cache.config';
|
||||||
import { CollectionLoader } from './collection-loader';
|
import { CollectionLoader } from './collection-loader';
|
||||||
|
import { PostgresExtensionService } from './postgres-extension.service';
|
||||||
import { BaseQueryCacheWriteConsumer } from './base-query-cache.write-consumer';
|
import { BaseQueryCacheWriteConsumer } from './base-query-cache.write-consumer';
|
||||||
import { BaseQueryCacheSubscriber } from './base-query-cache.subscriber';
|
import { BaseQueryCacheSubscriber } from './base-query-cache.subscriber';
|
||||||
import { EnvironmentService } from '../../../integrations/environment/environment.service';
|
import { EnvironmentService } from '../../../integrations/environment/environment.service';
|
||||||
@@ -56,6 +57,12 @@ class FakeEnvService {
|
|||||||
getBaseQueryCacheDebug() {
|
getBaseQueryCacheDebug() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
getBaseQueryCacheMemoryLimit() {
|
||||||
|
return '64MB';
|
||||||
|
}
|
||||||
|
getBaseQueryCacheThreads() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
getRedisUrl() {
|
getRedisUrl() {
|
||||||
return REDIS_URL;
|
return REDIS_URL;
|
||||||
}
|
}
|
||||||
@@ -124,6 +131,12 @@ describeIntegration('BaseQueryCacheService LRU eviction', () => {
|
|||||||
getBaseQueryCacheDebug() {
|
getBaseQueryCacheDebug() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
getBaseQueryCacheMemoryLimit() {
|
||||||
|
return '64MB';
|
||||||
|
}
|
||||||
|
getBaseQueryCacheThreads() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
getRedisUrl() {
|
getRedisUrl() {
|
||||||
return REDIS_URL;
|
return REDIS_URL;
|
||||||
}
|
}
|
||||||
@@ -169,6 +182,7 @@ describeIntegration('BaseQueryCacheService LRU eviction', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: EnvironmentService, useClass: TinyCapEnvService },
|
{ provide: EnvironmentService, useClass: TinyCapEnvService },
|
||||||
QueryCacheConfigProvider,
|
QueryCacheConfigProvider,
|
||||||
|
PostgresExtensionService,
|
||||||
BaseRepo,
|
BaseRepo,
|
||||||
BasePropertyRepo,
|
BasePropertyRepo,
|
||||||
BaseRowRepo,
|
BaseRowRepo,
|
||||||
@@ -323,6 +337,7 @@ describeIntegration('BaseQueryCacheService integration', () => {
|
|||||||
const providers: any[] = [
|
const providers: any[] = [
|
||||||
{ provide: EnvironmentService, useClass: FakeEnvService },
|
{ provide: EnvironmentService, useClass: FakeEnvService },
|
||||||
QueryCacheConfigProvider,
|
QueryCacheConfigProvider,
|
||||||
|
PostgresExtensionService,
|
||||||
BaseRepo,
|
BaseRepo,
|
||||||
BasePropertyRepo,
|
BasePropertyRepo,
|
||||||
BaseRowRepo,
|
BaseRowRepo,
|
||||||
@@ -762,6 +777,12 @@ describeIntegration('BaseQueryCacheService warm-up on boot', () => {
|
|||||||
getBaseQueryCacheDebug() {
|
getBaseQueryCacheDebug() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
getBaseQueryCacheMemoryLimit() {
|
||||||
|
return '64MB';
|
||||||
|
}
|
||||||
|
getBaseQueryCacheThreads() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
getRedisUrl() {
|
getRedisUrl() {
|
||||||
return REDIS_URL;
|
return REDIS_URL;
|
||||||
}
|
}
|
||||||
@@ -800,6 +821,7 @@ describeIntegration('BaseQueryCacheService warm-up on boot', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: EnvironmentService, useClass: WarmUpEnvService },
|
{ provide: EnvironmentService, useClass: WarmUpEnvService },
|
||||||
QueryCacheConfigProvider,
|
QueryCacheConfigProvider,
|
||||||
|
PostgresExtensionService,
|
||||||
BaseRepo,
|
BaseRepo,
|
||||||
BasePropertyRepo,
|
BasePropertyRepo,
|
||||||
BaseRowRepo,
|
BaseRowRepo,
|
||||||
|
|||||||
Reference in New Issue
Block a user