-
Notifications
You must be signed in to change notification settings - Fork 381
chore: setup e2e tests #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
87fa791
init
sr07asthana 6d2e824
setup cli
sr07asthana 8437ec5
add invariants and update lib.ts
sr07asthana 88a7918
add cases
sr07asthana 6d6f79c
nit
sr07asthana 329af59
nit
sr07asthana 2b541ef
nit
sr07asthana a4e7c23
Merge branch 'main' into sr-e2e-tests-setup
sr07asthana d15b4ae
nit
sr07asthana 8736d9b
nit
sr07asthana bb11b65
nit
sr07asthana 06aeaf2
nit
sr07asthana 30c2de5
nit
sr07asthana 05b7318
Merge branch 'main' into sr-e2e-tests-setup
sr07asthana 85c4692
nit
sr07asthana c839d97
nit
sr07asthana a3df4ba
nit
sr07asthana 1cab37c
Merge branch 'main' into sr-e2e-tests-setup
sr07asthana 900f42f
nit
sr07asthana 62aaeae
Merge branch 'main' into sr-e2e-tests-setup
sr07asthana a9145a1
Merge branch 'main' into sr-e2e-tests-setup
sr07asthana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@truefoundry/trueforge': patch | ||
| --- | ||
|
|
||
| Add a local end-to-end test command (`pnpm test:e2e`) that starts its own stack, runs session checks, and tears everything down. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Full-stack E2E contract. Same topology as docker-compose.yml (smoke); isolated | ||
| # project name, host ports, and env_file so it does not collide with host-dev | ||
| # (8790/5432/6379) or smoke (8791/5433/6380). Postgres has no host bind mount so | ||
| # `scripts/e2e.sh` `down -v` discards the DB. Keep image versions and healthchecks | ||
| # in sync with docker-compose.yml / docker-compose.dev.yml. | ||
| name: trueforge-e2e | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:17 | ||
| env_file: | ||
| - path: packages/trueforge/e2e/.env | ||
| required: true | ||
| # Host 5434 avoids conflict with docker-compose.dev.yml on 5432 and smoke on 5433. | ||
| ports: | ||
| - '5434:5432' | ||
| healthcheck: | ||
| test: ['CMD-SHELL', 'pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"'] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 10 | ||
| restart: unless-stopped | ||
|
|
||
| # Shared by all server replicas: carries executor peering (cross-replica | ||
| # turn cancel via request-reply). | ||
| redis: | ||
| image: redis:7-alpine | ||
| # Host 6381 avoids conflict with docker-compose.dev.yml on 6379 and smoke on 6380. | ||
| ports: | ||
| - '6381:6379' | ||
| healthcheck: | ||
| test: ['CMD', 'redis-cli', 'ping'] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 5 | ||
| restart: unless-stopped | ||
|
|
||
| # Serves both the API and the UI on one port. | ||
| server: | ||
| build: | ||
| context: . | ||
| # From-source image; root Dockerfile is the npm-install prod recipe. | ||
| dockerfile: Dockerfile.dev | ||
| image: truefoundry-server:latest | ||
| ports: | ||
| # Host 8792 avoids conflict with host `pnpm dev` on 8790 and smoke on 8791. | ||
| - '8792:8790' | ||
| environment: | ||
| # Wins over env_file / image defaults so a host .env cannot flip this. | ||
| NODE_ENV: production | ||
| # Inside the container; host mapping above is 8792. | ||
| PORT: 8790 | ||
| # Wins over env_file / Node default `localhost` (::1 vs healthcheck 127.0.0.1). | ||
| HOST: 0.0.0.0 | ||
| # Host-facing origin for MCP OAuth callbacks (mapped port, not container PORT). | ||
| PUBLIC_BASE_URL: http://localhost:8792 | ||
| # Compose network hosts — do not use packages/trueforge/e2e/.env localhost values. | ||
| POSTGRES_HOST: postgres | ||
| POSTGRES_PORT: 5432 | ||
| # Compose runs one replica but keeps peering on so the peered cancel path | ||
| # stays exercised. STANDALONE=false ⇒ Postgres + Redis. | ||
| STANDALONE: 'false' | ||
| REDIS_URL: redis://redis:6379 | ||
| # Postgres credentials (POSTGRES_USER, …) and later E2E secrets. | ||
| # `environment` above overrides any colliding keys from this file. | ||
| env_file: | ||
| - path: packages/trueforge/e2e/.env | ||
| required: true | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
| redis: | ||
| condition: service_healthy | ||
| # Probes GET /healthz (plain text OK!); node is already in the image. | ||
| healthcheck: | ||
| test: | ||
| [ | ||
| 'CMD', | ||
| 'node', | ||
| '-e', | ||
| "fetch('http://127.0.0.1:8790/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))", | ||
| ] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 10 | ||
| start_period: 15s | ||
| # Above the app's default GRACEFUL_TIMEOUT_SECONDS (30) so SIGKILL does not | ||
| # cut off turn drain. | ||
| stop_grace_period: 35s | ||
| restart: unless-stopped |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copy to `.env` (git-ignored). Used by docker-compose.e2e.yml (postgres + server) | ||
| # and by the E2E CLI. Do not point this file at host-dev ports. | ||
| # | ||
| # Compose maps the API to http://127.0.0.1:8792 (not 8790 / 8791). | ||
|
|
||
| # --- Postgres (required for the e2e compose postgres service) --- | ||
| POSTGRES_USER=trueforge | ||
| POSTGRES_PASSWORD=trueforge | ||
| POSTGRES_DB=trueforge | ||
|
|
||
| # --- CLI (model + Daytona) --- | ||
| # Model FQN `provider/model`, e.g. openai/gpt-4.1-mini | ||
| MODEL=openai/gpt-4.1-mini | ||
| MODEL_API_KEY= | ||
| DAYTONA_API_KEY= | ||
| # Per-turn wait ceiling in milliseconds (default 180000 when unset). | ||
| TEST_TIMEOUT_MS=180000 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.