Skip to content

Commit

Permalink
Remove TEST_RUN property as it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkoKauhanen committed Jan 3, 2025
1 parent 20f23ee commit 97730b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion aoe-infra/environments/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"NODE_ENV": "production",
"LOG_LEVEL": "error",
"PORT_LISTEN": "8080",
"TEST_RUN": "false",
"MATERIAL_VERSION_URL": "https://dev.aoe.fi/#/materiaali/",
"HTTP_OPTIONS_TIMEOUT": "5000",
"HTTP_OPTIONS_RETRY": "2",
Expand Down
2 changes: 0 additions & 2 deletions aoe-web-backend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ PORT=3000

NODE_TLS_REJECT_UNAUTHORIZED=0

TEST_RUN=true

## AOE server and service component general purpose configurations
SERVER_CONFIG_OAIPMH_ANALYTICS_URL=http://aoe-data-analytics:8080

Expand Down
12 changes: 2 additions & 10 deletions aoe-web-backend/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const missingEnvs: string[] = [];
process.env.NODE_ENV || missingEnvs.push('NODE_ENV');
process.env.PORT_LISTEN || missingEnvs.push('PORT_LISTEN');
process.env.LOG_LEVEL || missingEnvs.push('LOG_LEVEL');
process.env.TEST_RUN || missingEnvs.push('TEST_RUN');
process.env.CLOUD_STORAGE_ENABLED || missingEnvs.push('CLOUD_STORAGE_ENABLED');
process.env.CLOUD_STORAGE_REGION || missingEnvs.push('CLOUD_STORAGE_REGION');
process.env.CLOUD_STORAGE_BUCKET || missingEnvs.push('CLOUD_STORAGE_BUCKET');
Expand Down Expand Up @@ -48,14 +47,8 @@ process.env.STREAM_STATUS_PATH || missingEnvs.push('STREAM_STATUS_PATH');
process.env.STREAM_STATUS_HOST_HTTPS_ENABLED || missingEnvs.push('STREAM_STATUS_HOST_HTTPS_ENABLED');
process.env.PID_API_KEY || missingEnvs.push('PID_API_KEY');
process.env.PID_SERVICE_URL || missingEnvs.push('PID_SERVICE_URL');

if (process.env.TEST_RUN === 'true') {
process.env.PG_USER || missingEnvs.push('POSTGRES_USER');
process.env.PG_PASS || missingEnvs.push('POSTGRES_PASSWORD');
} else {
process.env.PG_USER || missingEnvs.push('POSTGRES_USER_SECONDARY');
process.env.PG_PASS || missingEnvs.push('POSTGRES_PASSWORD_SECONDARY');
}
process.env.PG_USER || missingEnvs.push('PG_USER');
process.env.PG_PASS || missingEnvs.push('PG_PASS');

if (missingEnvs.length > 0) {
winstonLogger.error('All required environment variables are not available: %s', missingEnvs);
Expand All @@ -69,7 +62,6 @@ export default {
logLevel: process.env.LOG_LEVEL as string,
nodeEnv: process.env.NODE_ENV as string,
portListen: parseInt(process.env.PORT_LISTEN as string, 10) as number,
testRun: ((process.env.TEST_RUN as string).toLowerCase() === 'true') as boolean,
} as const,

// Cloud storage configurations.
Expand Down

0 comments on commit 97730b0

Please sign in to comment.