LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
327 stars 157 forks source link

PostgreSQL container image should use schema tool for schema creation #3802

Open punktilious opened 2 years ago

punktilious commented 2 years ago

Is your feature request related to a problem? Please describe. Technical debt.

Describe the solution you'd like Currently the postgres container image hosting the FHIRDB database uses a build script under build/docker/postgres/init/db.sql. This script executes a number of SQL commands to create the schema and grant privileges to the FHIRSERVER user.

Creation of the schema and the granting of privileges is handled by the schema cli tool. By performing these operations as part of the db.sql script, our tests are not properly exercising the schema cli tool.

Action: remove the relevant statements from the db.sql script and update the pipeline test (and any related documentation) to use the schema cli tool to perform the schema creation and grant functions.

Describe alternatives you've considered Leave as-is and accept the test weakness.

Acceptance Criteria

  1. GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]

Additional context N/A

lmsurpre commented 1 year ago

The recommended approach is now used in our demo docker-compose environments. Its also used by the new integration test workflows like build/azurite and build/minio.

I'll leave this one open for now though because we're still using the old approach in at least one spot: build/persistence/postgres