test(backend): add route-level integration tests for admin indexer endpoints (#847) #911
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Test Gate | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| contracts-test: | |
| name: Contracts cargo test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Run cargo test | |
| run: cargo test | |
| working-directory: contracts | |
| backend-test: | |
| name: Backend npm test | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: flowfi_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci --include=optional | |
| - name: Prepare database schema | |
| run: | | |
| npx prisma generate --schema=prisma/schema.prisma | |
| npx prisma db push --accept-data-loss --schema=prisma/schema.prisma | |
| working-directory: backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:password@127.0.0.1:5432/flowfi_test | |
| # mirrors the ci.yml backend job: vitest's coverage provider is | |
| # enabled by default in backend/vitest.config.ts, so the @vitest/ | |
| # coverage-v8 package must be present before `npm test` runs. | |
| # Also installs the rollup native binding into backend/node_modules | |
| # (where vitest actually resolves it from) rather than the root. | |
| - name: Install Vitest + Native Bindings | |
| run: | | |
| npm install @vitest/coverage-v8@2.1.9 --no-save | |
| npm install @rollup/rollup-linux-x64-gnu --no-save | |
| working-directory: backend | |
| - name: Run backend tests | |
| run: | | |
| ls -la src/generated/prisma | |
| npm test --silent -- --reporter=basic | |
| working-directory: backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:password@127.0.0.1:5432/flowfi_test | |
| NODE_ENV: test |