You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85ea094
Browse filesBrowse the repository at this point in the historyBrowse files
chore(redis): require Redis and remove the no-Redis fallbacks (#10272)
* chore(redis): require Redis and remove the configuration fallbacks
* chore(redis): remove the remaining no-Redis paths across the app, realtime, setup and deploy config
* fix(redis): resolve rate-limit storage lazily and address review findings
* improvement(redis): address review threads and simplify the leftovers of the fallback removal
* fix(redis): keep unit tests off a real Redis and update integration tests for lazy channels
* chore(redis): drop stale fallback references after rebasing
Copy file name to clipboardExpand all lines: .claude/rules/sim-testing.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ contracts, and demonstrated regressions.
34
34
| Suffix | Needs | Run with | In CI |
35
35
|--------|-------|----------|-------|
36
36
|`*.test.ts(x)`| nothing; global mocks from `vitest.setup.ts`|`bun run --cwd <workspace> test`|`test` jobs |
37
-
|`*.integration.ts`| real PostgreSQL (`TEST_DATABASE_URL`), Redis (`TEST_REDIS_URL`; optional locally, required in CI) |`bun run --cwd <workspace> test --mode integration`|`integration` jobs, by glob (sharded per provisioning path) |
37
+
|`*.integration.ts`| real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim` and `apps/realtime`; `packages/db` runs without it locally and requires it in CI) |`bun run --cwd <workspace> test --mode integration`|`integration` jobs, by glob (sharded per provisioning path) |
38
38
|`*.live.test.ts`| provider APIs, hosted sandboxes, local runtimes, or sibling checkouts |`bun run --cwd apps/sim test --mode live <file>`| never |
39
39
|`apps/desktop/e2e/*.spec.ts`| the packaged Electron app | Playwright | desktop E2E workflow |
40
40
|`apps/sim/scripts/test-*-e2e.ts`| a running app over HTTP | its `package.json` script when one exists (`bun run test:scim:e2e`; `test:workflow-version-compare:e2e` adds `--no-env-file`), else `bun scripts/test-<suite>-e2e.ts` from apps/sim |`e2e` jobs (`.github/scripts/http-e2e.sh`) |
@@ -46,7 +46,10 @@ contracts, and demonstrated regressions.
46
46
`vi.mock` in the file.
47
47
-`TEST_DATABASE_URL` must be loopback and its database name must contain a `test` segment
48
48
(`sim_test`); `TEST_REDIS_URL` must be loopback. `packages/db/testing/test-infrastructure.ts` owns
49
-
those checks. Isolate with a unique schema or generated IDs, and clean up in `afterAll`.
49
+
those checks. `apps/sim` integration setup runs `FLUSHDB` before every file, so its
50
+
`TEST_REDIS_URL` must also select a non-zero database (`redis://127.0.0.1:6379/15`); never
51
+
point it at a Redis holding data you want to keep. Isolate with a unique schema or generated
52
+
IDs, and clean up in `afterAll`.
50
53
- Integration files run one at a time against one shared database. A new `*.integration.ts` is
51
54
picked up by CI with no workflow change, and the run writes the JSON report configured in
52
55
`vitest.shared.ts`, which CI uploads. Never exclude a failing suite from the run in
Copy file name to clipboardExpand all lines: .cursor/rules/sim-testing.mdc
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ contracts, and demonstrated regressions.
31
31
| Suffix | Needs | Run with | In CI |
32
32
|--------|-------|----------|-------|
33
33
| `*.test.ts(x)` | nothing; global mocks from `vitest.setup.ts` | `bun run --cwd <workspace> test` | `test` jobs |
34
-
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`), Redis (`TEST_REDIS_URL`; optional locally, required in CI) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
34
+
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim` and `apps/realtime`; `packages/db` runs without it locally and requires it in CI) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
35
35
| `*.live.test.ts` | provider APIs, hosted sandboxes, local runtimes, or sibling checkouts | `bun run --cwd apps/sim test --mode live <file>` | never |
36
36
| `apps/desktop/e2e/*.spec.ts` | the packaged Electron app | Playwright | desktop E2E workflow |
37
37
| `apps/sim/scripts/test-*-e2e.ts` | a running app over HTTP | its `package.json` script when one exists (`bun run test:scim:e2e`; `test:workflow-version-compare:e2e` adds `--no-env-file`), else `bun scripts/test-<suite>-e2e.ts` from apps/sim | `e2e` jobs (`.github/scripts/http-e2e.sh`) |
@@ -43,7 +43,10 @@ contracts, and demonstrated regressions.
43
43
`vi.mock` in the file.
44
44
- `TEST_DATABASE_URL` must be loopback and its database name must contain a `test` segment
45
45
(`sim_test`); `TEST_REDIS_URL` must be loopback. `packages/db/testing/test-infrastructure.ts` owns
46
-
those checks. Isolate with a unique schema or generated IDs, and clean up in `afterAll`.
46
+
those checks. `apps/sim` integration setup runs `FLUSHDB` before every file, so its
47
+
`TEST_REDIS_URL` must also select a non-zero database (`redis://127.0.0.1:6379/15`); never
48
+
point it at a Redis holding data you want to keep. Isolate with a unique schema or generated
49
+
IDs, and clean up in `afterAll`.
47
50
- Integration files run one at a time against one shared database. A new `*.integration.ts` is
48
51
picked up by CI with no workflow change, and the run writes the JSON report configured in
49
52
`vitest.shared.ts`, which CI uploads. Never exclude a failing suite from the run in
Copy file name to clipboardExpand all lines: apps/docs/MACHINE_ACCESS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ The suite exercises real HTTP and the official MCP client, including discovery p
79
79
80
80
The PostgreSQL suite uses a new, empty, loopback database and no embedding key. It verifies real keyword search, citation freshness, graceful database failure, repeated index publication, retirement and failed-publication preservation. It refuses databases containing existing tables. CI provisions its own `pgvector/pgvector:pg17` service and uploads the report with the other docs checks.
81
81
82
-
The platform consumer harness also uses an empty loopback database and the running docs build. From `apps/sim`, run `bun --no-env-file scripts/test-docs-search-provider-e2e.ts` with `DOCS_PROVIDER_E2E_DATABASE_URL`, `DOCS_PROVIDER_E2E_BASE_URL` and `DOCS_PROVIDER_E2E_REPORT_PATH`. Its default mode uses the existing Azure endpoint configuration with a local HTTP fixture, deterministic vectors and the real PostgreSQL provider-admission store. It verifies the platform's direct-table search, scope exclusions, VFS reads and public citations, with no paid requests. This verifies the transport and consumer contract, not semantic relevance.
82
+
The platform consumer harness also uses an empty loopback database and the running docs build. From `apps/sim`, run `bun --no-env-file scripts/test-docs-search-provider-e2e.ts` with `DOCS_PROVIDER_E2E_DATABASE_URL`, `DOCS_PROVIDER_E2E_REDIS_URL` (a loopback Redis), `DOCS_PROVIDER_E2E_BASE_URL` and `DOCS_PROVIDER_E2E_REPORT_PATH`. Its default mode uses the existing Azure endpoint configuration with a local HTTP fixture, deterministic vectors and the real Redis provider-admission store. It verifies the platform's direct-table search, scope exclusions, VFS reads and public citations, with no paid requests. This verifies the transport and consumer contract, not semantic relevance.
83
83
84
84
Live provider verification is opt-in: set `DOCS_PROVIDER_E2E_ALLOW_LIVE=1` and supply `OPENAI_API_KEY`, using a fresh database named `docs_search_provider_test`. The harness limits publication to the introduction page, rejects plans above 15 chunks, and sends at most one batch with up to three attempts. The consumer makes at most one query embedding request, for a total cap of four provider requests. Provider failure stops the run and remains a failed report. The default fixture mode also accepts the empty `docs_search_test` database used by the PostgreSQL suite. Both modes remove their tables when finished.
|**ollama**|`ollama/ollama`| 11434 | Model cache | Optional |
@@ -36,7 +36,7 @@ The Bun Socket.IO server carries collaborative editing, live execution updates,
36
36
Realtime shares PostgreSQL and `BETTER_AUTH_SECRET` with the app, using Better Auth's shared-database-session pattern. It authenticates the same accounts without a separate login.
37
37
38
38
<Callouttype="warn">
39
-
More than one realtime replica requires `REDIS_URL`. The Socket.IO Redis adapter carries events between replicas; without it, members connected to different pods do not see each other's edits.
39
+
Realtime requires `REDIS_URL`, pointing at the same Redis as the app. The Socket.IO Redis adapter carries events between replicas, so members connected to different pods see each other's edits.
40
40
</Callout>
41
41
42
42
A realtime server must exist for editing and live updates. Set `realtime.enabled: false` in Helm only when `app.env.SOCKET_SERVER_URL` points to a realtime instance you run separately.
Redis carries live events and stores shared coordination state. Some stores fall back to PostgreSQL or process-local state, but cross-pod collaboration has no local fallback. CLI API-key pairing also requires Redis, even with one replica; OAuth login uses a separate path. See [Redis](/platform/self-hosting/redis) for the full fallback matrix.
58
+
Redis is required, even with one replica. It holds rate-limit buckets, one-time passcodes, and shared coordination state, and carries live events between processes. There is no PostgreSQL or process-local fallback, and the app refuses to start without `REDIS_URL`. See [Redis](/platform/self-hosting/redis) for everything it backs.
|`db`| Not published | PostgreSQL 17 with pgvector. |
92
-
|`redis`| Not published |Shared coordination, pub/sub, and caches. |
92
+
|`redis`| Not published |Required. Rate limits, shared coordination, pub/sub, and caches. |
93
93
|`cron`| None | Calls background job endpoints. |
94
94
|`migrations`| None | Applies migrations once, then exits. |
95
95
@@ -238,14 +238,14 @@ Invoke commands as `bunx sim-setup <command>` unless the package is installed gl
238
238
|`reset`| Confirms before archiving env files and removing managed Compose/dev data. On Helm it uninstalls the release; PostgreSQL StatefulSet PVCs remain and must be deleted separately to erase data. |
239
239
|`config`| Reports configured capabilities and integrations. |
|`add <feature>`| Configures `email`, `storage`, `sandbox`, `jobs`, `cache`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>`. Requires one writable configuration; refuses ambiguous destinations and Helm releases. |
241
+
|`add <feature>`| Configures `email`, `storage`, `sandbox`, `jobs`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>`. Requires one writable configuration; refuses ambiguous destinations and Helm releases. |
242
242
|`desktop`| Prints this deployment's installer/server links. `--url <url>` skips discovery; `--no-open` skips the browser-opening prompt. |
243
243
244
244
`--dir <path>` works with every command and scopes standalone lifecycle commands to that installation.
245
245
246
246
For Compose, `reset` archives `.env` beside the Compose file. For dev, Kubernetes, or no detected install, it archives `apps/sim/.env`, `apps/realtime/.env`, `packages/db/.env`, and root `.env`. Preserve any backups before intentionally removing volumes.
247
247
248
-
`add` writes beside the Compose file or to `apps/sim/.env` on a source checkout. Recreate containers that read the change: `cache` changes `REDIS_URL`for both app and realtime. For a source checkout, mirror shared values into `apps/realtime/.env`. `restart` alone does not apply changed container environment. Desktop discovery refuses configurations naming different origins; pass `--url` to choose.
248
+
`add` writes beside the Compose file or to `apps/sim/.env` on a source checkout. Recreate containers that read the change. To point both app and realtime at a different Redis, set `REDIS_URL`in `.env`and recreate both containers. For a source checkout, mirror shared values into `apps/realtime/.env`. `restart` alone does not apply changed container environment. Desktop discovery refuses configurations naming different origins; pass `--url` to choose.
0 commit comments