Commit cda75f10 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Changed naming of environment variables for the test database

parent e75002f6
Pipeline #42303 passed with stage
in 2 minutes and 14 seconds
......@@ -4,17 +4,15 @@ services:
- name: $CI_REGISTRY/dynamicexposure/server-components/containers/docker-obm-database:master
alias: postgres
# Make pip cache the installed dependencies
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POSTGRES_DB: testdatabase
POSTGRES_USER: tester
POSTGRES_PASSWORD: somepass
GDEIMPORTER_DB_HOST: postgres
GDEIMPORTER_DB: ${POSTGRES_DB}
GDEIMPORTER_USER: ${POSTGRES_USER}
GDEIMPORTER_PASSWORD: ${POSTGRES_PASSWORD}
GDEIMPORTER_SOURCEID: 1
GDECORE_DB_HOST: postgres
GDECORE_DB: ${POSTGRES_DB}
GDECORE_USER: ${POSTGRES_USER}
GDECORE_PASSWORD: ${POSTGRES_PASSWORD}
GDECORE_SOURCEID: 1
cache:
paths:
......
......@@ -125,13 +125,18 @@ class Configuration:
self.model_name = ConfigurationMethods.assign_parameter(config, "model_name")
self.database_gde_tiles = ConfigurationMethods.retrieve_database_credentials(
config, "database_gde_tiles", "test_db_gde_tiles.env", force_config_over_hierarchies
config,
"database_gde_tiles",
"test_db_gde_tiles.env",
"GDECORE",
force_config_over_hierarchies,
)
self.database_obm_buildings = ConfigurationMethods.retrieve_database_credentials(
config,
"database_obm_buildings",
"test_db_obm_buildings.env",
"GDECORE",
force_config_over_hierarchies,
)
......@@ -139,6 +144,7 @@ class Configuration:
config,
"database_completeness",
"test_db_completeness.env",
"GDECORE",
force_config_over_hierarchies,
)
......
......@@ -40,13 +40,13 @@ def test_db():
def init_test_db():
"""Populates the test database."""
if "GDEIMPORTER_DB_HOST" in os.environ: # When running the CI pipeline
if "GDECORE_DB_HOST" in os.environ: # When running the CI pipeline
db_built_up_config = {
"host": os.environ.get("GDEIMPORTER_DB_HOST"),
"dbname": os.environ.get("GDEIMPORTER_DB"),
"host": os.environ.get("GDECORE_DB_HOST"),
"dbname": os.environ.get("GDECORE_DB"),
"port": "",
"username": os.environ.get("GDEIMPORTER_USER"),
"password": os.environ.get("GDEIMPORTER_PASSWORD"),
"username": os.environ.get("GDECORE_USER"),
"password": os.environ.get("GDECORE_PASSWORD"),
}
# Create Database instance and establish the connection and cursor
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment