Spaces:
Paused
Paused
fix: resolve CI test failures by using raw sql.js adapter and adding redis service
Browse files
.github/workflows/ci.yml
CHANGED
|
@@ -15,6 +15,7 @@ jobs:
|
|
| 15 |
runs-on: ubuntu-latest
|
| 16 |
env:
|
| 17 |
DATABASE_URL: "postgresql://postgres:password@localhost:5432/widgetdc_test"
|
|
|
|
| 18 |
services:
|
| 19 |
postgres:
|
| 20 |
image: pgvector/pgvector:pg16
|
|
@@ -29,6 +30,16 @@ jobs:
|
|
| 29 |
--health-interval 10s
|
| 30 |
--health-timeout 5s
|
| 31 |
--health-retries 5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
permissions:
|
| 33 |
contents: read
|
| 34 |
|
|
|
|
| 15 |
runs-on: ubuntu-latest
|
| 16 |
env:
|
| 17 |
DATABASE_URL: "postgresql://postgres:password@localhost:5432/widgetdc_test"
|
| 18 |
+
REDIS_URL: "redis://localhost:6379"
|
| 19 |
services:
|
| 20 |
postgres:
|
| 21 |
image: pgvector/pgvector:pg16
|
|
|
|
| 30 |
--health-interval 10s
|
| 31 |
--health-timeout 5s
|
| 32 |
--health-retries 5
|
| 33 |
+
|
| 34 |
+
redis:
|
| 35 |
+
image: redis:alpine
|
| 36 |
+
ports:
|
| 37 |
+
- 6379:6379
|
| 38 |
+
options: >-
|
| 39 |
+
--health-cmd "redis-cli ping"
|
| 40 |
+
--health-interval 10s
|
| 41 |
+
--health-timeout 5s
|
| 42 |
+
--health-retries 5
|
| 43 |
permissions:
|
| 44 |
contents: read
|
| 45 |
|
apps/backend/src/tests/autonomous.integration.test.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
*/
|
| 15 |
|
| 16 |
import { describe, it, expect, beforeAll, afterAll, beforeEach } from 'vitest';
|
| 17 |
-
import { initializeDatabase, getDatabase } from '../database/index.js';
|
| 18 |
|
| 19 |
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 20 |
// TEST SETUP
|
|
@@ -25,7 +25,11 @@ let db: any;
|
|
| 25 |
beforeAll(async () => {
|
| 26 |
// Initialize test database
|
| 27 |
await initializeDatabase();
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
});
|
| 30 |
|
| 31 |
afterAll(async () => {
|
|
|
|
| 14 |
*/
|
| 15 |
|
| 16 |
import { describe, it, expect, beforeAll, afterAll, beforeEach } from 'vitest';
|
| 17 |
+
import { initializeDatabase, getDatabase, getSqlJsDatabase } from '../database/index.js';
|
| 18 |
|
| 19 |
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 20 |
// TEST SETUP
|
|
|
|
| 25 |
beforeAll(async () => {
|
| 26 |
// Initialize test database
|
| 27 |
await initializeDatabase();
|
| 28 |
+
// Use raw SqlJs database for Memory components that require .exec()
|
| 29 |
+
db = getSqlJsDatabase();
|
| 30 |
+
if (!db) {
|
| 31 |
+
throw new Error('Failed to initialize SqlJs database for testing');
|
| 32 |
+
}
|
| 33 |
});
|
| 34 |
|
| 35 |
afterAll(async () => {
|