Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c4da138
Add e2e tests for trailbase-db-collection package
claude Dec 31, 2025
c84008d
Integrate shared e2e test suites from db-collection-e2e
claude Dec 31, 2025
8146e2b
Add syncMode support to trailbase-db-collection
claude Dec 31, 2025
12dfec1
Include createProgressiveTestSuite in e2e tests
claude Dec 31, 2025
0e03371
Add test hooks for progressive mode to enable full e2e test coverage
claude Dec 31, 2025
0618774
Add Docker setup and update global-setup to start TrailBase container
claude Dec 31, 2025
4847d2a
Add support for TrailBase binary as alternative to Docker for e2e tests
claude Dec 31, 2025
f71c3ce
Update pnpm-lock.yaml with db-collection-e2e dependency
claude Dec 31, 2025
7ebd8c9
chore: trailbase bin for testing
MentalGear Dec 31, 2025
33043a9
Fix TrailBase e2e setup: UUID primary keys and multi-path binary dete…
claude Dec 31, 2025
de2e33e
fix: trailbase x86 linux bin zip instead of arm
MentalGear Dec 31, 2025
c60c000
Merge branch 'claude/add-trailbase-e2e-tests-GRew7' of https://github…
MentalGear Dec 31, 2025
e1f5498
Fix e2e test setup: STRICT mode, correct trailbase imports, and aliases
claude Dec 31, 2025
53f159c
fix: add correct trail binary
MentalGear Jan 1, 2026
390a077
Fix e2e mutations to use insert-specific serializers (89/118 tests pass)
claude Jan 1, 2026
57a7f52
Switch to UUID primary keys with TrailBase is_uuid_v7 CHECK
claude Jan 1, 2026
4ceaec0
Use INTEGER PKs with ID mapping for mutations
claude Jan 1, 2026
392c933
Add debug logging for subscription events
claude Jan 1, 2026
e7923cd
feat(trailbase): Improve e2e test compatibility (114/118 passing)
claude Jan 1, 2026
826230a
fix(trailbase): Add loadSubset caching to prevent race conditions (11…
claude Jan 1, 2026
d4a67c2
refactor(trailbase): Switch to camelCase column names and fix UUID so…
claude Jan 1, 2026
569f867
fix(trailbase): Use promise-based loadSubset caching to prevent race …
claude Jan 1, 2026
44861fc
Merge pull request #1 from MentalGear/claude/add-trailbase-e2e-tests-…
MentalGear Jan 1, 2026
4ccbfed
Merge branch 'TanStack:main' into main
MentalGear Jan 5, 2026
5fe3b69
refactor(trailbase): Remove redundant unit tests covered by E2E
claude Jan 5, 2026
96e1b3a
ci: apply automated fixes
autofix-ci[bot] Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/trailbase-db-collection/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# E2E test temp data directories
.trailbase-e2e-data-*
17 changes: 17 additions & 0 deletions packages/trailbase-db-collection/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM trailbase/trailbase:latest

USER root
WORKDIR /app

RUN mkdir -p /app/traildepot/migrations

COPY config.textproto /app/traildepot/config.textproto
COPY init.sql /app/traildepot/migrations/V10__init.sql

RUN chown -R trailbase:trailbase /app/traildepot && \
chmod -R 777 /app/traildepot

EXPOSE 4000

USER trailbase
CMD ["/app/trail", "--data-dir", "/app/traildepot", "run", "--address", "0.0.0.0:4000", "--dev"]
26 changes: 26 additions & 0 deletions packages/trailbase-db-collection/docker/config.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
email {}
server {
application_name: "TrailBase E2E"
}
auth {}
jobs {}
record_apis: [
{
name: "users_e2e"
table_name: "users_e2e"
acl_world: [CREATE, READ, UPDATE, DELETE]
enable_subscriptions: true
},
{
name: "posts_e2e"
table_name: "posts_e2e"
acl_world: [CREATE, READ, UPDATE, DELETE]
enable_subscriptions: true
},
{
name: "comments_e2e"
table_name: "comments_e2e"
acl_world: [CREATE, READ, UPDATE, DELETE]
enable_subscriptions: true
}
]
15 changes: 15 additions & 0 deletions packages/trailbase-db-collection/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
trailbase:
build:
context: .
dockerfile: Dockerfile
ports:
- '4000:4000'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:4000/api/healthz']
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
35 changes: 35 additions & 0 deletions packages/trailbase-db-collection/docker/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- E2E Test Tables for TrailBase
-- Using BLOB UUID PRIMARY KEY with auto-generated uuid_v7()
-- Using is_uuid() check to accept both v4 and v7 UUIDs
-- Using camelCase column names to match @tanstack/db-collection-e2e types

CREATE TABLE "users_e2e" (
"id" BLOB PRIMARY KEY NOT NULL CHECK(is_uuid(id)) DEFAULT (uuid_v7()),
"name" TEXT NOT NULL,
"email" TEXT,
"age" INTEGER NOT NULL,
"isActive" INTEGER NOT NULL DEFAULT 1,
"createdAt" TEXT NOT NULL,
"metadata" TEXT,
"deletedAt" TEXT
) STRICT;

CREATE TABLE "posts_e2e" (
"id" BLOB PRIMARY KEY NOT NULL CHECK(is_uuid(id)) DEFAULT (uuid_v7()),
"userId" TEXT NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT,
"viewCount" INTEGER NOT NULL DEFAULT 0,
"largeViewCount" TEXT NOT NULL,
"publishedAt" TEXT,
"deletedAt" TEXT
) STRICT;

CREATE TABLE "comments_e2e" (
"id" BLOB PRIMARY KEY NOT NULL CHECK(is_uuid(id)) DEFAULT (uuid_v7()),
"postId" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"text" TEXT NOT NULL,
"createdAt" TEXT NOT NULL,
"deletedAt" TEXT
) STRICT;
Loading