fix(cli): e2e backend PR adjustments

This commit is contained in:
Ivan Shmidt
2020-07-27 14:38:07 +02:00
parent 411b4af8bc
commit e5ed8f95d1
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
services:
postgres:
image: postgres:10.8
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
+5 -5
View File
@@ -50,7 +50,7 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) {
'POSTGRES_USER',
'POSTGRES_HOST',
'POSTGRES_PASSWORD',
].every(key => Object.keys(process.env).includes(key));
].every(key => config.getOptional(`backend.${key}`));
let knexConfig;
@@ -59,10 +59,10 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) {
client: 'pg',
useNullAsDefault: true,
connection: {
port: process.env.POSTGRES_PORT,
host: process.env.POSTGRES_HOST,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
port: config.getOptionalNumber('backend.POSTGRES_PORT'),
host: config.getString('backend.POSTGRES_HOST'),
user: config.getString('backend.POSTGRES_USER'),
password: config.getString('backend.POSTGRES_PASSWORD'),
database: `backstage_plugin_${plugin}`,
} as PgConnectionConfig,
};
+4 -2
View File
@@ -318,7 +318,7 @@ async function testBackendStart(appDir, isPostgres) {
await waitFor(() => stdout.includes('Listening on ') || stderr !== '');
if (stderr !== '') {
// Skipping the whole block
throw new Error();
throw new Error(stderr);
}
print('Try to fetch entities from the backend');
@@ -328,6 +328,8 @@ async function testBackendStart(appDir, isPostgres) {
);
print('Entities fetched successfully');
successful = true;
} catch (error) {
throw new Error(`Backend failed to startup: ${error}`);
} finally {
print('Stopping the child process');
// Kill entire process group, otherwise we'll end up with hanging serve processes
@@ -338,7 +340,7 @@ async function testBackendStart(appDir, isPostgres) {
await waitForExit(child);
} catch (error) {
if (!successful) {
throw error;
throw new Error(`Backend failed to startup: ${stderr}`);
}
print('Backend startup test finished successfully');
}
@@ -29,8 +29,6 @@ AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x \
AUTH_GITHUB_CLIENT_ID=x AUTH_GITHUB_CLIENT_SECRET=x \
AUTH_OAUTH2_CLIENT_ID=x AUTH_OAUTH2_CLIENT_SECRET=x \
AUTH_OAUTH2_AUTH_URL=x AUTH_OAUTH2_TOKEN_URL=x \
ROLLBAR_ACCOUNT_TOKEN=x \
SENTRY_TOKEN=x \
LOG_LEVEL=debug \
yarn start
```