Skip to content

Commit

Permalink
fix: also change DATABASE_ID to ELECTRIC_DATABASE_ID (#1934)
Browse files Browse the repository at this point in the history
Missed this when working on
#1927
  • Loading branch information
KyleAMathews authored Nov 6, 2024
1 parent 3ff3def commit d34cb7e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ts_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
run:
working-directory: ${{ matrix.package_dir }}
env:
DATABASE_ID: ci_test_tenant
ELECTRIC_DATABASE_ID: ci_test_tenant
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
mix run --no-halt &
wait-on: |
http-get://localhost:3000/v1/health?database_id=${{ env.DATABASE_ID }}
http-get://localhost:3000/v1/health?database_id=${{ env.ELECTRIC_DATABASE_ID }}
tail: true
log-output-resume: stderr
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/_macros.luxinc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
[shell $shell_name]
-$fail_pattern

!DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url ELECTRIC_PORT=$port $env ../scripts/electric_dev.sh
!ELECTRIC_DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url ELECTRIC_PORT=$port $env ../scripts/electric_dev.sh
[endmacro]

[macro teardown]
Expand Down
2 changes: 1 addition & 1 deletion packages/react-hooks/test/support/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { makePgClient } from './test-helpers'

const url = process.env.ELECTRIC_URL ?? `http://localhost:3000`
const proxyUrl = process.env.ELECTRIC_PROXY_CACHE_URL ?? `http://localhost:3002`
const databaseId = process.env.DATABASE_ID ?? `test_tenant`
const databaseId = process.env.ELECTRIC_DATABASE_ID ?? `test_tenant`

// name of proxy cache container to execute commands against,
// see docker-compose.yml that spins it up for details
Expand Down
2 changes: 1 addition & 1 deletion packages/sync-service/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ ELECTRIC_CACHE_MAX_AGE=1
ELECTRIC_CACHE_STALE_AGE=3
# using a small chunk size of 10kB for dev to speed up tests
ELECTRIC_LOG_CHUNK_BYTES_THRESHOLD=10000
DATABASE_ID=test_tenant
ELECTRIC_DATABASE_ID=test_tenant
# configuring a second database for multi-tenancy integration testing
OTHER_DATABASE_URL=postgresql://postgres:password@localhost:54322/electric?sslmode=disable
2 changes: 1 addition & 1 deletion packages/sync-service/.env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
LOG_LEVEL=info
DATABASE_URL=postgresql://postgres:password@localhost:54321/postgres?sslmode=disable
DATABASE_ID=test_tenant
ELECTRIC_DATABASE_ID=test_tenant
4 changes: 2 additions & 2 deletions packages/sync-service/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ config :opentelemetry,
processors: [otel_batch_processor, otel_simple_processor] |> Enum.reject(&is_nil/1)

database_url = env!("DATABASE_URL", :string, nil)
default_tenant = env!("DATABASE_ID", :string, nil)
default_tenant = env!("ELECTRIC_DATABASE_ID", :string, nil)

case {database_url, default_tenant} do
{nil, nil} ->
# No default tenant provided
:ok

{nil, _} ->
raise "DATABASE_URL must be provided when DATABASE_ID is set"
raise "DATABASE_URL must be provided when ELECTRIC_DATABASE_ID is set"

{_, _} ->
# A default tenant is provided
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-client/test/support/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Client } from 'pg'

const url = process.env.ELECTRIC_URL ?? `http://localhost:3000`
const proxyUrl = process.env.ELECTRIC_PROXY_CACHE_URL ?? `http://localhost:3002`
const databaseId = process.env.DATABASE_ID ?? `test_tenant`
const databaseId = process.env.ELECTRIC_DATABASE_ID ?? `test_tenant`
const otherDatabaseId = `other_test_tenant`
const otherDatabaseUrl =
process.env.OTHER_DATABASE_URL ??
Expand Down

0 comments on commit d34cb7e

Please sign in to comment.