From cf94b0ba6c713ad5286aa5f2daf78a7fa876eadd Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 15:17:59 +0200 Subject: [PATCH] ci(test): split into unit (no DB) and integration (postgres) jobs --- .gitea/workflows/test.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 0ea059d..1089cf9 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -6,9 +6,25 @@ on: pull_request: jobs: - test: + # Unit tests — no database required. + # All business logic is tested via TestStore (in-memory port implementations). + unit: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: unit tests + run: | + cargo test --workspace \ + --exclude postgres \ + --exclude postgres-federation \ + --exclude postgres-search + # Integration tests — require a real PostgreSQL instance. + # These test that the SQL queries in the adapter crates are correct. + integration: + runs-on: ubuntu-latest services: postgres: image: postgres:16 @@ -22,16 +38,15 @@ jobs: --health-retries 5 ports: - 5432:5432 - env: DATABASE_URL: postgres://postgres:postgres@localhost:5432/thoughts_test - steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - - name: test - run: cargo test --workspace + - name: integration tests + run: | + cargo test \ + -p postgres \ + -p postgres-federation \ + -p postgres-search