A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
ci: Run tests on push (#807)
Mohamed Bassem39358b1517a0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 8216c7cf..127c7990 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -48,6 +48,16 @@ jobs:- name: Typecheckrun: pnpm typecheck+ tests:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4++ - name: Setup+ uses: ./tooling/github/setup++ - name: Tests+ run: pnpm testopen-api-spec:runs-on: ubuntu-lateststeps:diff --git a/apps/web/package.json b/apps/web/package.jsonindex ec0a3bd2..d78b1d4d 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -10,7 +10,6 @@"build": "next build","start": "next start","lint": "next lint",- "test": "vitest","typecheck": "tsc --noEmit","format": "prettier --check . --ignore-path ../../.gitignore","format:fix": "prettier --write . --ignore-path ../../.gitignore",diff --git a/package.json b/package.jsonindex 66bfbaee..c9ad5633 100644--- a/package.json+++ b/package.json@@ -19,7 +19,8 @@"lint:fix": "turbo --no-daemon lint --continue -- --fix --cache-location node_modules/.cache/.eslintcache","lint:ws": "pnpm dlx sherif@latest","postinstall": "pnpm lint:ws",- "typecheck": "turbo --no-daemon typecheck"+ "typecheck": "turbo --no-daemon typecheck",+ "test": "turbo --no-daemon test --continue"},"devDependencies": {"@hoarder/prettier-config": "workspace:^0.1.0",diff --git a/packages/db/drizzle.ts b/packages/db/drizzle.tsindex 4763d9d7..037f7c35 100644--- a/packages/db/drizzle.ts+++ b/packages/db/drizzle.ts@@ -12,7 +12,7 @@ export const db = drizzle(sqlite, { schema });export function getInMemoryDB(runMigrations: boolean) {const mem = new Database(":memory:");- const db = drizzle(mem, { schema, logger: true });+ const db = drizzle(mem, { schema, logger: false });if (runMigrations) {migrate(db, { migrationsFolder: path.resolve(__dirname, "./drizzle") });}diff --git a/packages/shared/package.json b/packages/shared/package.jsonindex 93d5495a..b5a001b9 100644--- a/packages/shared/package.json+++ b/packages/shared/package.json@@ -26,7 +26,8 @@"format:fix": "prettier . --write --ignore-path ../../.prettierignore","lint": "eslint .","lint:fix": "eslint . --fix",- "test": "vitest"+ "test": "vitest run",+ "test:watch": "vitest"},"main": "index.ts","eslintConfig": {diff --git a/packages/trpc/package.json b/packages/trpc/package.jsonindex 0e1721f1..00652b8d 100644--- a/packages/trpc/package.json+++ b/packages/trpc/package.json@@ -10,7 +10,8 @@"format:fix": "prettier . --write --ignore-path ../../.prettierignore","lint": "eslint .","lint:fix": "eslint . --fix",- "test": "vitest"+ "test": "vitest run",+ "test:watch": "vitest"},"dependencies": {"@hoarder/db": "workspace:*",diff --git a/packages/trpc/testUtils.ts b/packages/trpc/testUtils.tsindex 23dcdb33..6d7e6dee 100644--- a/packages/trpc/testUtils.ts+++ b/packages/trpc/testUtils.ts@@ -1,5 +1,6 @@import { getInMemoryDB } from "@hoarder/db/drizzle";import { users } from "@hoarder/db/schema";+import { runQueueDBMigrations } from "@hoarder/shared/queues";import { createCallerFactory } from "./index";import { appRouter } from "./routers/_app";@@ -54,6 +55,7 @@ export interface CustomTestContext {export async function buildTestContext(seedDB: boolean,): Promise<CustomTestContext> {+ runQueueDBMigrations();const db = getTestDB();let users: Awaited<ReturnType<typeof seedUsers>> = [];if (seedDB) {diff --git a/turbo.json b/turbo.jsonindex 3422151b..7256d8e2 100644--- a/turbo.json+++ b/turbo.json@@ -48,6 +48,7 @@"node_modules/.cache/tsbuildinfo.json"]},+ "test": {},"clean": {"cache": false},