Skip to content

Commit 2ab022d

Browse files
yahondaclaude
andcommitted
Drop hardcoded DATABASE_VERSION from database_version spec
The "should get database version" spec compared PLSQL::Connection #database_version against a DATABASE_VERSION env var set in each workflow. The value was brittle: the test.yml / test_gemfiles.yml rows hardcoded "23.26.1.0" (the Instant Client version), which couples the spec to a manually maintained string that has to track whichever gvenzl/oracle-free container is currently in use. Drop the env var dependency and assert the structural shape instead (an Array of four Integers) so the spec remains meaningful across Oracle Database releases without a hardcoded version to maintain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8363f52 commit 2ab022d

5 files changed

Lines changed: 4 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
DATABASE_NAME: FREEPDB1
3030
TZ: Europe/Riga
3131
DATABASE_SYS_PASSWORD: Oracle18
32-
DATABASE_VERSION: 23.26.1.0
3332

3433
services:
3534
oracle:

.github/workflows/test_11g.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
DATABASE_NAME: XE
3030
TZ: Europe/Riga
3131
DATABASE_SYS_PASSWORD: Oracle18
32-
DATABASE_VERSION: 11.2.0.2
3332

3433
services:
3534
oracle:

.github/workflows/test_gemfiles.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
DATABASE_NAME: FREEPDB1
4444
TZ: Europe/Riga
4545
DATABASE_SYS_PASSWORD: Oracle18
46-
DATABASE_VERSION: 23.26.1.0
4746

4847
services:
4948
oracle:

spec/plsql/connection_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,10 @@
422422

423423
describe "session information" do
424424
it "should get database version" do
425-
# using Oracle version 10.2.0.4 for unit tests
426-
expect(@conn.database_version).to eq DATABASE_VERSION.split(".").map { |n| n.to_i }
425+
version = @conn.database_version
426+
expect(version).to be_an(Array)
427+
expect(version.size).to eq(4)
428+
expect(version).to all(be_a(Integer))
427429
end
428430

429431
it "should get session ID" do

spec/spec_helper.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,10 @@
5353
[ENV["DATABASE_USER"] || "hr", ENV["DATABASE_PASSWORD"] || "hr"],
5454
[ENV["DATABASE_USER2"] || "arunit", ENV["DATABASE_PASSWORD2"] || "arunit"]
5555
]
56-
# specify which database version is used (will be verified in one test)
57-
DATABASE_VERSION = ENV["DATABASE_VERSION"] || "10.2.0.4"
58-
5956
if ENV["USE_VM_DATABASE"] == "Y"
6057
RSpec.configure do |config|
6158
config.before(:suite) do
6259
TestDb.build
63-
64-
# Set Verbose off to hide warning: already initialized constant DATABASE_VERSION
65-
original_verbosity = $VERBOSE
66-
$VERBOSE = nil
67-
DATABASE_VERSION = TestDb.database_version
68-
$VERBOSE = original_verbosity
6960
end
7061
end
7162
end

0 commit comments

Comments
 (0)