Skip to content

Commit 0787a78

Browse files
committed
Simplify test configuration by removing redundant environment variables
Removed PARADEDB_WITH_PG: - pg gem is now always included unconditionally in Gemfile - Rails ParadeDB is a PostgreSQL library, pg should always be available - Matches pattern from django-paradedb which always includes psycopg Removed PARADEDB_INTEGRATION: - Redundant check - just test if PARADEDB_TEST_DSN exists - If DSN is set, use PostgreSQL; otherwise use SQLite - Simpler logic with same behavior This aligns better with django-paradedb's simpler approach.
1 parent 9ae2226 commit 0787a78

4 files changed

Lines changed: 4 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ env:
1111
POSTGRES_USER: postgres
1212
POSTGRES_PASSWORD: postgres
1313
POSTGRES_DB: postgres
14-
PARADEDB_WITH_PG: "1"
1514

1615
jobs:
1716
test:
@@ -49,8 +48,6 @@ jobs:
4948
--health-retries 12
5049
5150
env:
52-
PARADEDB_WITH_PG: "1"
53-
PARADEDB_INTEGRATION: "1"
5451
PARADEDB_TEST_DSN: postgresql://postgres@localhost:5432/postgres
5552
PGPASSWORD: postgres
5653

Gemfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@ source "https://rubygems.org"
22

33
gem "activerecord", "~> 8.1"
44
gem "activesupport", "~> 8.1"
5+
gem "pg", "~> 1.5"
56
gem "sqlite3", "~> 2.0"
6-
7-
if ENV["PARADEDB_WITH_PG"] == "1"
8-
gem "pg", "~> 1.5"
9-
end

scripts/run_integration_tests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ set -euo pipefail
44

55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66

7-
export PARADEDB_WITH_PG=1
8-
97
source "${SCRIPT_DIR}/rbenv_bootstrap.sh"
108

119
# Only start Docker container if not in CI (CI uses services)
@@ -18,7 +16,6 @@ USER="${PARADEDB_USER:-postgres}"
1816
PASSWORD="${PARADEDB_PASSWORD:-postgres}"
1917
DB="${PARADEDB_DB:-postgres}"
2018

21-
export PARADEDB_INTEGRATION=1
2219
export PARADEDB_TEST_DSN="postgres://${USER}:${PASSWORD}@localhost:${PORT}/${DB}"
2320
export PGPASSWORD="${PASSWORD}"
2421

spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
ActiveRecord::Base.logger = nil
88

99
def establish_test_connection
10-
if ENV["PARADEDB_INTEGRATION"] == "1" && ENV["PARADEDB_TEST_DSN"]
10+
if ENV["PARADEDB_TEST_DSN"]
11+
# Integration tests: use real ParadeDB/PostgreSQL
1112
ActiveRecord::Base.establish_connection(ENV["PARADEDB_TEST_DSN"])
1213
else
14+
# Unit tests: use SQLite in-memory database
1315
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
1416
end
1517
end

0 commit comments

Comments
 (0)