Skip to content

Commit f06b5f4

Browse files
committed
Fix image tests to pass against Firebird 6 snapshots
FIREBIRD_DATABASE_PAGE_SIZE test: - Change from 4096 to 8192 as the small page size under test Firebird 6 raised the minimum page size to 8192 (4096 is rounded up silently) FIREBIRD_CONF_can_change_any_setting test: - Replace FileSystemCacheThreshold (removed in FB6) with TempCacheLimit TempCacheLimit exists in all supported versions (3, 4, 5, 6) - Also remove the duplicate DefaultDbCachePages env var in the container params Tag_correctness_via_docker_inspect test: - Accept snapshot version labels (e.g. '5-snapshot') in addition to semver Snapshot images have FIREBIRD_VERSION set to the tag name, not a semver
1 parent b0597b6 commit f06b5f4

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/image.tests.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ task FIREBIRD_DATABASE_can_create_database_with_unicode_characters {
214214
}
215215

216216
task FIREBIRD_DATABASE_PAGE_SIZE_can_set_page_size_on_database_creation {
217-
Use-Container -Parameters '-e', 'FIREBIRD_DATABASE=test.fdb', '-e', 'FIREBIRD_DATABASE_PAGE_SIZE=4096' {
217+
Use-Container -Parameters '-e', 'FIREBIRD_DATABASE=test.fdb', '-e', 'FIREBIRD_DATABASE_PAGE_SIZE=8192' {
218218
param($cId)
219219

220220
'SET LIST ON; SELECT mon$page_size FROM mon$database;' |
221221
docker exec -i $cId isql -b -q /var/lib/firebird/data/test.fdb |
222-
Contains -Pattern 'MON\$PAGE_SIZE(\s+)4096' -ErrorMessage "Expected database page size to be 4096."
222+
Contains -Pattern 'MON\$PAGE_SIZE(\s+)8192' -ErrorMessage "Expected database page size to be 8192."
223223
}
224224

225225
Use-Container -Parameters '-e', 'FIREBIRD_DATABASE=test.fdb', '-e', 'FIREBIRD_DATABASE_PAGE_SIZE=16384' {
@@ -319,12 +319,14 @@ task FIREBIRD_USE_LEGACY_AUTH_enables_legacy_auth {
319319
}
320320

321321
task FIREBIRD_CONF_can_change_any_setting {
322-
Use-Container -Parameters '-e', 'FIREBIRD_CONF_DefaultDbCachePages=64K', '-e', 'FIREBIRD_CONF_DefaultDbCachePages=64K', '-e', 'FIREBIRD_CONF_FileSystemCacheThreshold=100M' {
322+
# DefaultDbCachePages and TempCacheLimit exist in all supported Firebird versions (3, 4, 5, 6).
323+
# FileSystemCacheThreshold was removed in Firebird 6 so we intentionally avoid it.
324+
Use-Container -Parameters '-e', 'FIREBIRD_CONF_DefaultDbCachePages=64K', '-e', 'FIREBIRD_CONF_TempCacheLimit=100M' {
323325
param($cId)
324326

325327
$logs = docker logs $cId
326328
$logs | Contains -Pattern "DefaultDbCachePages = 64K" -ErrorMessage "Expected log message 'DefaultDbCachePages = 64K'."
327-
$logs | Contains -Pattern "FileSystemCacheThreshold = 100M" -ErrorMessage "Expected log message 'FileSystemCacheThreshold = 100M'."
329+
$logs | Contains -Pattern "TempCacheLimit = 100M" -ErrorMessage "Expected log message 'TempCacheLimit = 100M'."
328330
}
329331
}
330332

@@ -539,5 +541,6 @@ task Tag_correctness_via_docker_inspect {
539541
$labels = docker inspect --format '{{json .Config.Labels}}' $env:FULL_IMAGE_NAME | ConvertFrom-Json
540542
$version = $labels.'org.opencontainers.image.version'
541543
assert ($null -ne $version) "Expected 'org.opencontainers.image.version' label to be set."
542-
assert ($version -match '^\d+\.\d+\.\d+$') "Expected version label '$version' to match semantic version pattern."
544+
# Accept either a semver release (e.g. '5.0.3') or a snapshot tag (e.g. '5-snapshot', '6-snapshot')
545+
assert ($version -match '^\d+\.\d+\.\d+$' -or $version -match '^\d+-snapshot$') "Expected version label '$version' to be semver or snapshot format."
543546
}

0 commit comments

Comments
 (0)