Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Dec 26, 2025

Summary

  • Adds comprehensive database schema and seed data for integration tests
  • Enables integration tests in GitHub Actions CI (Linux only)
  • Fixes test isolation issues between test suites

Changes

Database Schema

  • Created migration file with all required tables:
    • users: Supports both PostgrestIntegrationTests and PostgrestBasicTests
    • todos: For todo-related integration tests
    • channels and messages: For messaging tests
    • key_value_storage: For Realtime integration tests
  • Added RPC functions: get_status, void_func, delete_user
  • Configured Row Level Security policies for all tables
  • Enabled Realtime publication for key_value_storage

Seed Data

  • Added seed data for PostgrestBasicTests (users, channels, messages)
  • Ensures consistent test data across test runs

CI Integration

  • Added new integration-tests job to GitHub Actions
  • Runs on Linux (ubuntu-latest) using Supabase CLI
  • Automatically starts Supabase, applies migrations, runs tests, and cleans up
  • Uses Docker to run local Supabase instance

Test Fixes

  • Updated PostgrestBasicTests.testBasicSelectTable to select specific columns
  • Modified PostgrestIntegrationTests setUp to only delete test data, preserving seed data

Test plan

  • Verified integration tests pass on macOS with fresh database
  • Created database migration and seed files
  • CI will verify integration tests pass on Linux

🤖 Generated with Claude Code

- Create database migration with tables for all integration tests:
  - users, todos, channels, messages, key_value_storage
  - RPC functions: get_status, void_func, delete_user
  - Row Level Security policies
  - Realtime publication for key_value_storage
- Add seed data for PostgrestBasicTests
- Add integration-tests job to GitHub Actions CI (Linux only)
- Update PostgrestBasicTests to select specific columns
- Update PostgrestIntegrationTests cleanup to preserve seed data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@grdsdev grdsdev changed the title feat(test): add integration tests to CI with database schema test: add integration tests to CI with database schema Dec 26, 2025
grdsdev and others added 2 commits December 26, 2025 10:48
… and users

Add foreign key constraint from messages.username to users.username to enable
PostgREST embedded queries. This fixes PostgrestResourceEmbeddingTests failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…olation

- Add get_username_and_status RPC function for PostgrestFilterTests
- Add get_array_element RPC function for PostgrestTransformsTests
- Fix user cleanup in PostgrestIntegrationTests to use AnyJSON.null

These changes fix the remaining RPC function errors and improve test isolation
by properly filtering out test data while preserving seed data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants