@jamesaphoenix/tx-test-utils 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +480 -0
- package/dist/adapters/better-sqlite3-adapter.d.ts +36 -0
- package/dist/adapters/better-sqlite3-adapter.d.ts.map +1 -0
- package/dist/adapters/better-sqlite3-adapter.js +78 -0
- package/dist/adapters/better-sqlite3-adapter.js.map +1 -0
- package/dist/chaos/chaos-utilities.d.ts +465 -0
- package/dist/chaos/chaos-utilities.d.ts.map +1 -0
- package/dist/chaos/chaos-utilities.js +793 -0
- package/dist/chaos/chaos-utilities.js.map +1 -0
- package/dist/chaos/chaos.test.d.ts +9 -0
- package/dist/chaos/chaos.test.d.ts.map +1 -0
- package/dist/chaos/chaos.test.js +498 -0
- package/dist/chaos/chaos.test.js.map +1 -0
- package/dist/chaos/index.d.ts +20 -0
- package/dist/chaos/index.d.ts.map +1 -0
- package/dist/chaos/index.js +39 -0
- package/dist/chaos/index.js.map +1 -0
- package/dist/database/index.d.ts +1 -1
- package/dist/database/index.d.ts.map +1 -1
- package/dist/database/index.js +1 -1
- package/dist/database/index.js.map +1 -1
- package/dist/database/test-database.d.ts +25 -5
- package/dist/database/test-database.d.ts.map +1 -1
- package/dist/database/test-database.js +142 -11
- package/dist/database/test-database.js.map +1 -1
- package/dist/factories/index.d.ts +0 -3
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/factories/index.js +0 -6
- package/dist/factories/index.js.map +1 -1
- package/dist/factories/learning.factory.js +1 -1
- package/dist/factories/learning.factory.js.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/shared-test-layer.d.ts +74 -0
- package/dist/helpers/shared-test-layer.d.ts.map +1 -0
- package/dist/helpers/shared-test-layer.js +104 -0
- package/dist/helpers/shared-test-layer.js.map +1 -0
- package/dist/helpers/sqlite-factory.d.ts +49 -0
- package/dist/helpers/sqlite-factory.d.ts.map +1 -0
- package/dist/helpers/sqlite-factory.js +74 -0
- package/dist/helpers/sqlite-factory.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -8
- package/dist/index.js.map +1 -1
- package/dist/singleton.d.ts +49 -0
- package/dist/singleton.d.ts.map +1 -0
- package/dist/singleton.js +66 -0
- package/dist/singleton.js.map +1 -0
- package/package.json +11 -10
- package/dist/factories/factories.test.d.ts +0 -8
- package/dist/factories/factories.test.d.ts.map +0 -1
- package/dist/factories/factories.test.js +0 -419
- package/dist/factories/factories.test.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chaos Engineering Utilities for tx
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable primitives for hardening tx through controlled failures.
|
|
5
|
+
* Use these utilities to test race conditions, failures, and edge cases.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { chaos } from '@tx/test-utils'
|
|
10
|
+
*
|
|
11
|
+
* await chaos.raceWorkers(5, taskId)
|
|
12
|
+
* await chaos.crashAfter(100)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @module @tx/test-utils/chaos
|
|
16
|
+
*/
|
|
17
|
+
export {
|
|
18
|
+
// Process failure simulation
|
|
19
|
+
crashAfter, CrashSimulationError,
|
|
20
|
+
// Worker heartbeat manipulation
|
|
21
|
+
killHeartbeat, WorkerHeartbeatController,
|
|
22
|
+
// Race condition testing
|
|
23
|
+
raceWorkers,
|
|
24
|
+
// State corruption
|
|
25
|
+
corruptState,
|
|
26
|
+
// JSONL replay
|
|
27
|
+
replayJSONL,
|
|
28
|
+
// Double completion testing
|
|
29
|
+
doubleComplete,
|
|
30
|
+
// Partial write simulation
|
|
31
|
+
partialWrite,
|
|
32
|
+
// Delayed claim testing
|
|
33
|
+
delayedClaim,
|
|
34
|
+
// Stress testing
|
|
35
|
+
stressLoad } from "./chaos-utilities.js";
|
|
36
|
+
// Convenience default export for namespace-style usage
|
|
37
|
+
import * as chaosUtilities from "./chaos-utilities.js";
|
|
38
|
+
export const chaos = chaosUtilities;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chaos/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO;AACL,6BAA6B;AAC7B,UAAU,EACV,oBAAoB;AAGpB,gCAAgC;AAChC,aAAa,EACb,yBAAyB;AAEzB,yBAAyB;AACzB,WAAW;AAGX,mBAAmB;AACnB,YAAY;AAGZ,eAAe;AACf,WAAW;AAIX,4BAA4B;AAC5B,cAAc;AAGd,2BAA2B;AAC3B,YAAY;AAGZ,wBAAwB;AACxB,YAAY;AAGZ,iBAAiB;AACjB,UAAU,EAGX,MAAM,sBAAsB,CAAA;AAE7B,uDAAuD;AACvD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAA;AACtD,MAAM,CAAC,MAAM,KAAK,GAAG,cAAc,CAAA"}
|
package/dist/database/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @tx/test-utils/database
|
|
5
5
|
*/
|
|
6
|
-
export { createTestDatabase, TestDatabaseService, TestDatabaseLive, createTestDatabaseLayer } from "./test-database.js";
|
|
6
|
+
export { createTestDatabase, TestDatabaseService, TestDatabaseLive, createTestDatabaseLayer, wrapDbAsTestDatabase } from "./test-database.js";
|
|
7
7
|
export type { TestDatabase } from "./test-database.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/database/index.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @tx/test-utils/database
|
|
5
5
|
*/
|
|
6
|
-
export { createTestDatabase, TestDatabaseService, TestDatabaseLive, createTestDatabaseLayer } from "./test-database.js";
|
|
6
|
+
export { createTestDatabase, TestDatabaseService, TestDatabaseLive, createTestDatabaseLayer, wrapDbAsTestDatabase } from "./test-database.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA"}
|
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @tx/test-utils/database
|
|
8
8
|
*/
|
|
9
|
-
import Database from "better-sqlite3";
|
|
10
9
|
import { Context, Effect, Layer } from "effect";
|
|
10
|
+
import { type SqliteRunResult } from "@jamesaphoenix/tx-core";
|
|
11
|
+
type DatabaseInstance = unknown;
|
|
11
12
|
/**
|
|
12
13
|
* Interface for test database operations.
|
|
13
|
-
*
|
|
14
|
+
* Works with both bun:sqlite (Bun test) and better-sqlite3 (Vitest).
|
|
14
15
|
*/
|
|
15
16
|
export interface TestDatabase {
|
|
16
|
-
/** The underlying better-sqlite3 Database
|
|
17
|
-
readonly db:
|
|
17
|
+
/** The underlying database instance (bun:sqlite Database or better-sqlite3 Database) */
|
|
18
|
+
readonly db: DatabaseInstance;
|
|
18
19
|
/** Close the database connection */
|
|
19
20
|
readonly close: () => Effect.Effect<void>;
|
|
20
21
|
/** Delete all data from tables (preserves schema and migrations table) */
|
|
@@ -24,7 +25,7 @@ export interface TestDatabase {
|
|
|
24
25
|
/** Execute raw SQL (DDL or DML) */
|
|
25
26
|
readonly exec: (sql: string) => void;
|
|
26
27
|
/** Execute a parameterized INSERT/UPDATE/DELETE and return run result */
|
|
27
|
-
readonly run: (sql: string, params?: unknown[]) =>
|
|
28
|
+
readonly run: (sql: string, params?: unknown[]) => SqliteRunResult;
|
|
28
29
|
/** Execute a function within a transaction */
|
|
29
30
|
readonly transaction: <T>(fn: () => T) => T;
|
|
30
31
|
}
|
|
@@ -97,5 +98,24 @@ export declare const TestDatabaseLive: Layer.Layer<TestDatabaseService, Error, n
|
|
|
97
98
|
* ```
|
|
98
99
|
*/
|
|
99
100
|
export declare const createTestDatabaseLayer: () => Layer.Layer<TestDatabaseService, Error>;
|
|
101
|
+
/**
|
|
102
|
+
* Wrap a raw database instance (bun:sqlite or better-sqlite3) as a TestDatabase interface.
|
|
103
|
+
*
|
|
104
|
+
* Use this to wrap the singleton test database from getSharedTestLayer()
|
|
105
|
+
* for use with factories that require a TestDatabase.
|
|
106
|
+
*
|
|
107
|
+
* @param db - The raw database instance (bun:sqlite Database or better-sqlite3 Database)
|
|
108
|
+
* @returns A TestDatabase wrapper
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* import { getSharedTestLayer, wrapDbAsTestDatabase, CandidateFactory } from '@jamesaphoenix/tx-test-utils'
|
|
113
|
+
*
|
|
114
|
+
* const shared = await getSharedTestLayer()
|
|
115
|
+
* const testDb = wrapDbAsTestDatabase(shared.getDb())
|
|
116
|
+
* const factory = new CandidateFactory(testDb)
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare const wrapDbAsTestDatabase: (db: DatabaseInstance) => TestDatabase;
|
|
100
120
|
export {};
|
|
101
121
|
//# sourceMappingURL=test-database.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-database.d.ts","sourceRoot":"","sources":["../../src/database/test-database.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"test-database.d.ts","sourceRoot":"","sources":["../../src/database/test-database.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAmB,KAAK,eAAe,EAAuB,MAAM,wBAAwB,CAAA;AAGnG,KAAK,gBAAgB,GAAG,OAAO,CAAA;AAE/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAA;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACzC,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAA;IACrE,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,yEAAyE;IACzE,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,eAAe,CAAA;IAClE,8CAA8C;IAC9C,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAC5C;;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,wBAGtC;CAAG;AAEN;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAsGnE,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,gDAG5B,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,QAAO,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAI9E,CAAA;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,gBAAgB,KAAG,YAqF3D,CAAA"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @tx/test-utils/database
|
|
8
8
|
*/
|
|
9
|
-
import Database from "better-sqlite3";
|
|
10
9
|
import { Context, Effect, Layer } from "effect";
|
|
11
10
|
import { applyMigrations } from "@jamesaphoenix/tx-core";
|
|
12
11
|
/**
|
|
@@ -37,16 +36,37 @@ export class TestDatabaseService extends Context.Tag("TestDatabaseService")() {
|
|
|
37
36
|
* await Effect.runPromise(testDb.close())
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
|
-
export const createTestDatabase = () => Effect.
|
|
41
|
-
try: () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
db
|
|
45
|
-
|
|
39
|
+
export const createTestDatabase = () => Effect.tryPromise({
|
|
40
|
+
try: async () => {
|
|
41
|
+
// Detect test runner: Vitest uses process.env.VITEST, Bun test uses Bun
|
|
42
|
+
const useBetterSqlite3 = typeof process !== "undefined" && process.env.VITEST === "true";
|
|
43
|
+
let db;
|
|
44
|
+
let rawDb;
|
|
45
|
+
if (useBetterSqlite3) {
|
|
46
|
+
// Vitest: Use better-sqlite3 for proper parallelization
|
|
47
|
+
const { wrapBetterSqlite3 } = await import("../adapters/better-sqlite3-adapter.js");
|
|
48
|
+
const Database = (await import("better-sqlite3")).default;
|
|
49
|
+
const betterDb = new Database(":memory:");
|
|
50
|
+
betterDb.pragma("journal_mode = WAL");
|
|
51
|
+
betterDb.pragma("foreign_keys = ON");
|
|
52
|
+
betterDb.pragma("busy_timeout = " + (process.env.TX_DB_BUSY_TIMEOUT || "5000"));
|
|
53
|
+
db = wrapBetterSqlite3(betterDb);
|
|
54
|
+
rawDb = betterDb;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Bun test: Use bun:sqlite
|
|
58
|
+
const { Database } = await import("bun:sqlite");
|
|
59
|
+
const bunDb = new Database(":memory:");
|
|
60
|
+
bunDb.run("PRAGMA journal_mode = WAL");
|
|
61
|
+
bunDb.run("PRAGMA foreign_keys = ON");
|
|
62
|
+
bunDb.run("PRAGMA busy_timeout = " + (process.env.TX_DB_BUSY_TIMEOUT || "5000"));
|
|
63
|
+
db = bunDb;
|
|
64
|
+
rawDb = bunDb;
|
|
65
|
+
}
|
|
46
66
|
// Run all migrations
|
|
47
67
|
applyMigrations(db);
|
|
48
68
|
const testDb = {
|
|
49
|
-
db,
|
|
69
|
+
db: rawDb,
|
|
50
70
|
close: () => Effect.sync(() => {
|
|
51
71
|
db.close();
|
|
52
72
|
}),
|
|
@@ -65,11 +85,11 @@ export const createTestDatabase = () => Effect.try({
|
|
|
65
85
|
`)
|
|
66
86
|
.all();
|
|
67
87
|
// Disable foreign keys temporarily to allow deletion in any order
|
|
68
|
-
db.
|
|
88
|
+
db.run("PRAGMA foreign_keys = OFF");
|
|
69
89
|
for (const { name } of tables) {
|
|
70
90
|
db.exec(`DELETE FROM "${name}"`);
|
|
71
91
|
}
|
|
72
|
-
db.
|
|
92
|
+
db.run("PRAGMA foreign_keys = ON");
|
|
73
93
|
}),
|
|
74
94
|
query: (sql, params = []) => {
|
|
75
95
|
return db.prepare(sql).all(...params);
|
|
@@ -81,7 +101,23 @@ export const createTestDatabase = () => Effect.try({
|
|
|
81
101
|
return db.prepare(sql).run(...params);
|
|
82
102
|
},
|
|
83
103
|
transaction: (fn) => {
|
|
84
|
-
|
|
104
|
+
// better-sqlite3 doesn't have transaction() method, use exec instead
|
|
105
|
+
if (useBetterSqlite3) {
|
|
106
|
+
db.exec("BEGIN");
|
|
107
|
+
try {
|
|
108
|
+
const result = fn();
|
|
109
|
+
db.exec("COMMIT");
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
db.exec("ROLLBACK");
|
|
114
|
+
throw e;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
// bun:sqlite has transaction() method
|
|
119
|
+
return rawDb.transaction(fn)();
|
|
120
|
+
}
|
|
85
121
|
}
|
|
86
122
|
};
|
|
87
123
|
return testDb;
|
|
@@ -127,4 +163,99 @@ export const TestDatabaseLive = Layer.scoped(TestDatabaseService, Effect.acquire
|
|
|
127
163
|
* ```
|
|
128
164
|
*/
|
|
129
165
|
export const createTestDatabaseLayer = () => Layer.scoped(TestDatabaseService, Effect.acquireRelease(createTestDatabase(), (db) => db.close()));
|
|
166
|
+
/**
|
|
167
|
+
* Wrap a raw database instance (bun:sqlite or better-sqlite3) as a TestDatabase interface.
|
|
168
|
+
*
|
|
169
|
+
* Use this to wrap the singleton test database from getSharedTestLayer()
|
|
170
|
+
* for use with factories that require a TestDatabase.
|
|
171
|
+
*
|
|
172
|
+
* @param db - The raw database instance (bun:sqlite Database or better-sqlite3 Database)
|
|
173
|
+
* @returns A TestDatabase wrapper
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* import { getSharedTestLayer, wrapDbAsTestDatabase, CandidateFactory } from '@jamesaphoenix/tx-test-utils'
|
|
178
|
+
*
|
|
179
|
+
* const shared = await getSharedTestLayer()
|
|
180
|
+
* const testDb = wrapDbAsTestDatabase(shared.getDb())
|
|
181
|
+
* const factory = new CandidateFactory(testDb)
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export const wrapDbAsTestDatabase = (db) => {
|
|
185
|
+
// Determine if it's bun:sqlite or better-sqlite3 by checking for .run() vs .pragma()
|
|
186
|
+
// better-sqlite3 has .pragma() method, bun:sqlite uses .run() for PRAGMA
|
|
187
|
+
const isBetterSqlite3 = typeof db.pragma === "function";
|
|
188
|
+
// Get SqliteDatabase interface - wrap better-sqlite3 if needed
|
|
189
|
+
let sqliteDb;
|
|
190
|
+
if (isBetterSqlite3) {
|
|
191
|
+
// For better-sqlite3, we need to wrap it (but this is sync, so we can't await)
|
|
192
|
+
// Actually, if it's already wrapped from getSharedTestLayer, it should already be SqliteDatabase
|
|
193
|
+
// Let's check if it has the SqliteDatabase interface methods
|
|
194
|
+
if (typeof db.prepare === "function") {
|
|
195
|
+
sqliteDb = db;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// Need to wrap it - but this requires async import
|
|
199
|
+
// For now, assume it's already wrapped or we'll handle it differently
|
|
200
|
+
sqliteDb = db;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
sqliteDb = db;
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
db,
|
|
208
|
+
close: () => Effect.sync(() => {
|
|
209
|
+
sqliteDb.close();
|
|
210
|
+
}),
|
|
211
|
+
reset: () => Effect.sync(() => {
|
|
212
|
+
// Get all user tables (exclude sqlite internals, migrations tracking, and FTS tables)
|
|
213
|
+
const tables = sqliteDb
|
|
214
|
+
.prepare(`
|
|
215
|
+
SELECT name FROM sqlite_master
|
|
216
|
+
WHERE type='table'
|
|
217
|
+
AND name NOT LIKE 'sqlite_%'
|
|
218
|
+
AND name != 'schema_version'
|
|
219
|
+
AND name NOT LIKE '%_fts'
|
|
220
|
+
AND name NOT LIKE '%_fts_%'
|
|
221
|
+
AND name NOT LIKE '%_config'
|
|
222
|
+
`)
|
|
223
|
+
.all();
|
|
224
|
+
// Disable foreign keys temporarily to allow deletion in any order
|
|
225
|
+
sqliteDb.run("PRAGMA foreign_keys = OFF");
|
|
226
|
+
for (const { name } of tables) {
|
|
227
|
+
sqliteDb.exec(`DELETE FROM "${name}"`);
|
|
228
|
+
}
|
|
229
|
+
sqliteDb.run("PRAGMA foreign_keys = ON");
|
|
230
|
+
}),
|
|
231
|
+
query: (sql, params = []) => {
|
|
232
|
+
return sqliteDb.prepare(sql).all(...params);
|
|
233
|
+
},
|
|
234
|
+
exec: (sql) => {
|
|
235
|
+
sqliteDb.exec(sql);
|
|
236
|
+
},
|
|
237
|
+
run: (sql, params = []) => {
|
|
238
|
+
return sqliteDb.prepare(sql).run(...params);
|
|
239
|
+
},
|
|
240
|
+
transaction: (fn) => {
|
|
241
|
+
// better-sqlite3 doesn't have transaction() method, use exec instead
|
|
242
|
+
if (isBetterSqlite3) {
|
|
243
|
+
sqliteDb.exec("BEGIN");
|
|
244
|
+
try {
|
|
245
|
+
const result = fn();
|
|
246
|
+
sqliteDb.exec("COMMIT");
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
sqliteDb.exec("ROLLBACK");
|
|
251
|
+
throw e;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
// bun:sqlite has transaction() method
|
|
256
|
+
return db.transaction(fn)();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
};
|
|
130
261
|
//# sourceMappingURL=test-database.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-database.js","sourceRoot":"","sources":["../../src/database/test-database.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"test-database.js","sourceRoot":"","sources":["../../src/database/test-database.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA6C,MAAM,wBAAwB,CAAA;AA0BnG;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,mBAAoB,SAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAGxE;CAAG;AAEN;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAuC,EAAE,CACzE,MAAM,CAAC,UAAU,CAAC;IAChB,GAAG,EAAE,KAAK,IAAI,EAAE;QACd,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,CAAA;QAExF,IAAI,EAAkB,CAAA;QACtB,IAAI,KAAuB,CAAA;QAE3B,IAAI,gBAAgB,EAAE,CAAC;YACrB,wDAAwD;YACxD,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,uCAAuC,CAAC,CAAA;YACnF,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAA;YACzD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAA;YACzC,QAAQ,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAA;YACrC,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;YACpC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC,CAAA;YAC/E,EAAE,GAAG,iBAAiB,CAAC,QA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M,CAAC;gBACN,sCAAsC;gBACtC,OAAQ,EAAmD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAA;YAC/E,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -8,8 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { TaskFactory, createTestTask, createTestTasks, type CreateTaskOptions } from "./task.factory.js";
|
|
10
10
|
export { LearningFactory, createTestLearning, createTestLearnings, type CreateLearningOptions } from "./learning.factory.js";
|
|
11
|
-
export { EdgeFactory, createTestEdge, createEdgeBetweenLearnings, type CreateEdgeOptions } from "./edge.factory.js";
|
|
12
|
-
export { AnchorFactory, createTestAnchor, type CreateAnchorOptions } from "./anchor.factory.js";
|
|
13
|
-
export { CandidateFactory, createTestCandidate, type CreateCandidateOptions, type LearningCandidate, type CandidateConfidence, type CandidateStatus } from "./candidate.factory.js";
|
|
14
11
|
export { fixtureId, namespacedFixtureId, sequentialFixtureIds, contentFixtureId } from "../fixtures/index.js";
|
|
15
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA"}
|
package/dist/factories/index.js
CHANGED
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
export { TaskFactory, createTestTask, createTestTasks } from "./task.factory.js";
|
|
11
11
|
// Learning factory
|
|
12
12
|
export { LearningFactory, createTestLearning, createTestLearnings } from "./learning.factory.js";
|
|
13
|
-
// Edge factory
|
|
14
|
-
export { EdgeFactory, createTestEdge, createEdgeBetweenLearnings } from "./edge.factory.js";
|
|
15
|
-
// Anchor factory
|
|
16
|
-
export { AnchorFactory, createTestAnchor } from "./anchor.factory.js";
|
|
17
|
-
// Candidate factory
|
|
18
|
-
export { CandidateFactory, createTestCandidate } from "./candidate.factory.js";
|
|
19
13
|
// Re-export fixture ID utilities for convenience
|
|
20
14
|
export { fixtureId, namespacedFixtureId, sequentialFixtureIds, contentFixtureId } from "../fixtures/index.js";
|
|
21
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAe;AACf,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EAEhB,MAAM,mBAAmB,CAAA;AAE1B,mBAAmB;AACnB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAe;AACf,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EAEhB,MAAM,mBAAmB,CAAA;AAE1B,mBAAmB;AACnB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAEpB,MA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O,CAAC,SAAS,IAAI,GAAG,CAAA;QAE1C,oDAAoD;QACpD,MAAM,eAAe,GAAG,SAAS;YAC/B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;YAC3E,CAAC,CAAC,IAAI,CAAA;QAER,IAAI,CAAC,EAAE,CAAC,GAAG,CACT;gDAC0C,EAC1C;YACE,EAAE;YACF,OAAO;YACP,UAAU;YACV,SAAS;YACT,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;YACxB,QAAQ;YACR,UAAU;YACV,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;YAC5C,YAAY;YACZ,eAAe;YACf,SAAS,CAAC,WAAW,EAAE;SACxB,CACF,CAAA;QAED,OAAO;YACL,EAAE,EAAE,EAAgB;YACpB,OAAO;YACP,UAAU;YACV,SAAS;YACT,QAAQ;YACR,QAAQ;YACR,UAAU;YACV,UAAU;YACV,YAAY;YACZ,SAAS;
|
|
1
|
+
{"version":3,"file":"learning.factory.js","sourceRoot":"","sources":["../../src/factories/learning.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqCH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,eAAe;IAClB,OAAO,GAAG,CAAC,CAAA;IACF,EAAE,CAAc;IAEjC,YAAY,EAAgB;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAiC,EAAE;QACxC,IAAI,CAAC,OAAO,EAAE,CAAA;QACd,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QAEtB,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAAA;QACrC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,IAAI,CAAC,OAAO,EAAE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AAM,kBAAkB,GAAG,CAChC,EAAgB,EAChB,UAAiC,EAAE,EACzB,EAAE;IACZ,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,CAAA;IACvC,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,EAAgB,EAChB,KAAa,EACb,UAAiC,EAAE,EACvB,EAAE;IACd,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,CAAA;IACvC,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAC3C,CAAC,CAAA"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
* @module @tx/test-utils/helpers
|
|
5
5
|
*/
|
|
6
6
|
export { runEffect, runEffectFail, runEffectEither, expectEffectSuccess, expectEffectFailure, mergeLayers, createTestContext, type RunEffectOptions, type EffectResult } from "./effect.js";
|
|
7
|
+
export { createSharedTestLayer, type SharedTestLayer, type SharedTestLayerResult } from "./shared-test-layer.js";
|
|
8
|
+
export { createSqliteDatabase, createMigratedSqliteDatabase } from "./sqlite-factory.js";
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// Effect test helpers
|
|
7
7
|
export { runEffect, runEffectFail, runEffectEither, expectEffectSuccess, expectEffectFailure, mergeLayers, createTestContext } from "./effect.js";
|
|
8
|
+
// Shared test layer for memory-efficient integration tests
|
|
9
|
+
export { createSharedTestLayer } from "./shared-test-layer.js";
|
|
10
|
+
// SQLite database factory — creates SqliteDatabase for both Vitest and Bun test
|
|
11
|
+
export { createSqliteDatabase, createMigratedSqliteDatabase } from "./sqlite-factory.js";
|
|
8
12
|
// TODO: Implement temp file helpers
|
|
9
13
|
// export { createTempDir, writeTestTypeScriptFile, createTestSourceFiles } from './temp-files.js'
|
|
10
14
|
// export type { TempDir } from './temp-files.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,sBAAsB;AACtB,OAAO,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EAGlB,MAAM,aAAa,CAAA;AAEpB,oCAAoC;AACpC,kGAAkG;AAClG,iDAAiD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,sBAAsB;AACtB,OAAO,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EAGlB,MAAM,aAAa,CAAA;AAEpB,2DAA2D;AAC3D,OAAO,EACL,qBAAqB,EAGtB,MAAM,wBAAwB,CAAA;AAE/B,gFAAgF;AAChF,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAE5B,oCAAoC;AACpC,kGAAkG;AAClG,iDAAiD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared test layer utilities for memory-efficient integration tests.
|
|
3
|
+
*
|
|
4
|
+
* Instead of creating a new database per test, creates ONE database per describe block
|
|
5
|
+
* and resets between tests. This reduces memory from ~54GB to ~8GB for the test suite.
|
|
6
|
+
*
|
|
7
|
+
* @module @tx/test-utils/helpers/shared-test-layer
|
|
8
|
+
*/
|
|
9
|
+
import { Layer } from "effect";
|
|
10
|
+
import type { SqliteDatabase } from "@jamesaphoenix/tx-core";
|
|
11
|
+
/**
|
|
12
|
+
* Result of creating a shared test layer.
|
|
13
|
+
*
|
|
14
|
+
* Note: This uses a type alias instead of Schema.Struct because:
|
|
15
|
+
* - It contains function properties (reset, close, getDb) which Schema.Struct doesn't support
|
|
16
|
+
* - It's a test utility type, not a domain type
|
|
17
|
+
* - The generic Layer type cannot be represented in Schema
|
|
18
|
+
*/
|
|
19
|
+
export type SharedTestLayer<L> = {
|
|
20
|
+
/** The Effect layer - pass to Effect.provide() */
|
|
21
|
+
readonly layer: Layer.Layer<L, never, never>;
|
|
22
|
+
/** Reset all database tables (call in afterEach) */
|
|
23
|
+
readonly reset: () => Promise<void>;
|
|
24
|
+
/** Close the database (call in afterAll) */
|
|
25
|
+
readonly close: () => Promise<void>;
|
|
26
|
+
/** The underlying SqliteDatabase instance */
|
|
27
|
+
readonly getDb: () => SqliteDatabase;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Create a shared app layer for testing.
|
|
31
|
+
*
|
|
32
|
+
* This creates ONE in-memory SQLite database that can be reset between tests.
|
|
33
|
+
* Much more memory-efficient than creating a new database per test.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import { createSharedTestLayer } from '@jamesaphoenix/tx-test-utils'
|
|
38
|
+
* import { describe, it, beforeAll, afterEach, afterAll } from 'vitest'
|
|
39
|
+
*
|
|
40
|
+
* describe('MyService', () => {
|
|
41
|
+
* let shared: SharedTestLayer<...>
|
|
42
|
+
*
|
|
43
|
+
* beforeAll(async () => {
|
|
44
|
+
* shared = await createSharedTestLayer()
|
|
45
|
+
* })
|
|
46
|
+
*
|
|
47
|
+
* afterEach(async () => {
|
|
48
|
+
* await shared.reset() // Clean slate between tests
|
|
49
|
+
* })
|
|
50
|
+
*
|
|
51
|
+
* afterAll(async () => {
|
|
52
|
+
* await shared.close()
|
|
53
|
+
* })
|
|
54
|
+
*
|
|
55
|
+
* it('test 1', async () => {
|
|
56
|
+
* const result = await Effect.runPromise(
|
|
57
|
+
* myEffect.pipe(Effect.provide(shared.layer))
|
|
58
|
+
* )
|
|
59
|
+
* })
|
|
60
|
+
* })
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const createSharedTestLayer: () => Promise<{
|
|
64
|
+
layer: Layer.Layer<import("@jamesaphoenix/tx-core").SyncService | import("@jamesaphoenix/tx-core").SqliteClient | import("@jamesaphoenix/tx-core").TaskService | import("@jamesaphoenix/tx-core").TaskRepository | import("@jamesaphoenix/tx-core").DependencyRepository | import("@jamesaphoenix/tx-core").DependencyService | import("@jamesaphoenix/tx-core").ReadyService | import("@jamesaphoenix/tx-core").HierarchyService | import("@jamesaphoenix/tx-core").LearningService | import("@jamesaphoenix/tx-core").LearningRepository | import("@jamesaphoenix/tx-core").RetrieverService | import("@jamesaphoenix/tx-core").FileLearningService | import("@jamesaphoenix/tx-core").FileLearningRepository | import("@jamesaphoenix/tx-core").AttemptService | import("@jamesaphoenix/tx-core").AttemptRepository | import("@jamesaphoenix/tx-core").RunRepository | import("@jamesaphoenix/tx-core").WorkerRepository | import("@jamesaphoenix/tx-core").ClaimRepository | import("@jamesaphoenix/tx-core").OrchestratorStateRepository | import("@jamesaphoenix/tx-core").DeduplicationRepository | import("@jamesaphoenix/tx-core").TrackedProjectRepository | import("@jamesaphoenix/tx-core").DocRepository | import("@jamesaphoenix/tx-core").DiversifierService | import("@jamesaphoenix/tx-core").WorkerService | import("@jamesaphoenix/tx-core").ClaimService | import("@jamesaphoenix/tx-core").OrchestratorService | import("@jamesaphoenix/tx-core").TracingService | import("@jamesaphoenix/tx-core").ValidationService | import("@jamesaphoenix/tx-core").LlmService | import("@jamesaphoenix/tx-core").DeduplicationService | import("@jamesaphoenix/tx-core").DocService | import("@jamesaphoenix/tx-core").AgentService | import("@jamesaphoenix/tx-core").CycleScanService | import("@jamesaphoenix/tx-core").MigrationService, import("@jamesaphoenix/tx-core").DatabaseError | import("@jamesaphoenix/tx-core").LlmUnavailableError | import("@jamesaphoenix/tx-core").AgentError, never>;
|
|
65
|
+
reset: () => Promise<void>;
|
|
66
|
+
close: () => Promise<void>;
|
|
67
|
+
getDb: () => SqliteDatabase;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Type helper for the return type of createSharedTestLayer.
|
|
71
|
+
* Use this when you need to type the shared layer variable.
|
|
72
|
+
*/
|
|
73
|
+
export type SharedTestLayerResult = Awaited<ReturnType<typeof createSharedTestLayer>>;
|
|
74
|
+
//# sourceMappingURL=shared-test-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-test-layer.d.ts","sourceRoot":"","sources":["../../src/helpers/shared-test-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IAC5C,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,cAAc,CAAA;CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,qBAAqB;;iBAyBR,OAAO,CAAC,IAAI,CAAC;iBA6Bb,OAAO,CAAC,IAAI,CAAC;iBAQnB,cAAc;EAQjC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared test layer utilities for memory-efficient integration tests.
|
|
3
|
+
*
|
|
4
|
+
* Instead of creating a new database per test, creates ONE database per describe block
|
|
5
|
+
* and resets between tests. This reduces memory from ~54GB to ~8GB for the test suite.
|
|
6
|
+
*
|
|
7
|
+
* @module @tx/test-utils/helpers/shared-test-layer
|
|
8
|
+
*/
|
|
9
|
+
import { Layer } from "effect";
|
|
10
|
+
/**
|
|
11
|
+
* Create a shared app layer for testing.
|
|
12
|
+
*
|
|
13
|
+
* This creates ONE in-memory SQLite database that can be reset between tests.
|
|
14
|
+
* Much more memory-efficient than creating a new database per test.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { createSharedTestLayer } from '@jamesaphoenix/tx-test-utils'
|
|
19
|
+
* import { describe, it, beforeAll, afterEach, afterAll } from 'vitest'
|
|
20
|
+
*
|
|
21
|
+
* describe('MyService', () => {
|
|
22
|
+
* let shared: SharedTestLayer<...>
|
|
23
|
+
*
|
|
24
|
+
* beforeAll(async () => {
|
|
25
|
+
* shared = await createSharedTestLayer()
|
|
26
|
+
* })
|
|
27
|
+
*
|
|
28
|
+
* afterEach(async () => {
|
|
29
|
+
* await shared.reset() // Clean slate between tests
|
|
30
|
+
* })
|
|
31
|
+
*
|
|
32
|
+
* afterAll(async () => {
|
|
33
|
+
* await shared.close()
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* it('test 1', async () => {
|
|
37
|
+
* const result = await Effect.runPromise(
|
|
38
|
+
* myEffect.pipe(Effect.provide(shared.layer))
|
|
39
|
+
* )
|
|
40
|
+
* })
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const createSharedTestLayer = async () => {
|
|
45
|
+
// Dynamically import to avoid circular dependencies
|
|
46
|
+
const { makeAppLayerFromInfra, SqliteClient, applyMigrations } = await import("@jamesaphoenix/tx-core");
|
|
47
|
+
// Use the shared factory — handles Vitest (better-sqlite3) vs Bun (bun:sqlite) detection
|
|
48
|
+
const { createSqliteDatabase } = await import("./sqlite-factory.js");
|
|
49
|
+
const db = await createSqliteDatabase();
|
|
50
|
+
// Apply migrations (now works with both implementations via SqliteDatabase interface)
|
|
51
|
+
applyMigrations(db);
|
|
52
|
+
// Use Layer.succeed to provide the concrete DB instance — this is a constant
|
|
53
|
+
// layer that always provides the same DB reference, unlike Layer.effect which
|
|
54
|
+
// would create a new connection on each build.
|
|
55
|
+
const infra = Layer.succeed(SqliteClient, db);
|
|
56
|
+
// Wrap with Layer.fresh so that service layers (repos, services) are NOT
|
|
57
|
+
// memoized across separate Effect.provide calls. This ensures each test gets
|
|
58
|
+
// fresh service instances while sharing the same underlying database.
|
|
59
|
+
const layer = Layer.fresh(makeAppLayerFromInfra(infra));
|
|
60
|
+
/**
|
|
61
|
+
* Reset all tables in the database.
|
|
62
|
+
* Preserves schema but deletes all data.
|
|
63
|
+
*/
|
|
64
|
+
const reset = async () => {
|
|
65
|
+
// Get all user tables (exclude sqlite internals, migrations tracking, and FTS tables)
|
|
66
|
+
const tables = db
|
|
67
|
+
.prepare(`
|
|
68
|
+
SELECT name FROM sqlite_master
|
|
69
|
+
WHERE type='table'
|
|
70
|
+
AND name NOT LIKE 'sqlite_%'
|
|
71
|
+
AND name != 'schema_version'
|
|
72
|
+
AND name NOT LIKE '%_fts'
|
|
73
|
+
AND name NOT LIKE '%_fts_%'
|
|
74
|
+
AND name NOT LIKE '%_config'
|
|
75
|
+
`)
|
|
76
|
+
.all();
|
|
77
|
+
// Disable foreign keys temporarily to allow deletion in any order
|
|
78
|
+
db.run("PRAGMA foreign_keys = OFF");
|
|
79
|
+
for (const { name } of tables) {
|
|
80
|
+
db.exec(`DELETE FROM "${name}"`);
|
|
81
|
+
}
|
|
82
|
+
// Reset auto-increment counters so IDs start from 1 in each test
|
|
83
|
+
db.exec("DELETE FROM sqlite_sequence");
|
|
84
|
+
db.run("PRAGMA foreign_keys = ON");
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Close the database connection.
|
|
88
|
+
*/
|
|
89
|
+
const close = async () => {
|
|
90
|
+
db.close();
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Get the underlying SqliteDatabase instance.
|
|
94
|
+
* Use with Layer.succeed(SqliteClient, shared.getDb()) for custom layers.
|
|
95
|
+
*/
|
|
96
|
+
const getDb = () => db;
|
|
97
|
+
return {
|
|
98
|
+
layer,
|
|
99
|
+
reset,
|
|
100
|
+
close,
|
|
101
|
+
getDb
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=shared-test-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-test-layer.js","sourceRoot":"","sources":["../../src/helpers/shared-test-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAA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