Merge pull request #1935 from spotify/rugvip/out

cli: fix stdout not being logged in e2e test cmd failures
This commit is contained in:
Patrik Oldsberg
2020-08-13 09:23:51 +02:00
committed by GitHub
5 changed files with 11 additions and 6 deletions
+3
View File
@@ -60,6 +60,9 @@ async function runPlain(cmd, options) {
});
return stdout.trim();
} catch (error) {
if (error.stdout) {
process.stdout.write(error.stdout);
}
if (error.stderr) {
process.stderr.write(error.stderr);
}
@@ -12,9 +12,10 @@ import { useHotCleanup } from '@backstage/backend-common';
export default async function createPlugin({
logger,
config,
database,
}: PluginEnvironment) {
const locationReader = new LocationReaders(logger);
const locationReader = new LocationReaders({ logger, config });
const db = await DatabaseManager.createDatabase(database, { logger });
const entitiesCatalog = new DatabaseEntitiesCatalog(db);
@@ -23,7 +23,7 @@ exports.up = async function up(knex) {
// Adds a single 'bootstrap' location that can be used to trigger work in processors.
// This is primarily here to fulfill foreign key constraints.
await knex('locations').insert({
id: 'bootstrap',
id: require('uuid').v4(),
type: 'bootstrap',
target: 'bootstrap',
});
@@ -35,7 +35,8 @@ exports.up = async function up(knex) {
exports.down = async function down(knex) {
await knex('locations')
.where({
id: 'bootstrap',
type: 'bootstrap',
target: 'bootstrap',
})
.del();
};
@@ -18,7 +18,7 @@ import { DatabaseManager } from '../database';
import { DatabaseLocationsCatalog } from './DatabaseLocationsCatalog';
const bootstrapLocation = {
id: 'bootstrap',
id: expect.any(String),
type: 'bootstrap',
target: 'bootstrap',
};
@@ -25,7 +25,7 @@ import type {
} from './types';
const bootstrapLocation = {
id: 'bootstrap',
id: expect.any(String),
type: 'bootstrap',
target: 'bootstrap',
message: null,
@@ -98,7 +98,7 @@ describe('CommonDatabase', () => {
expect.arrayContaining([output, bootstrapLocation]),
);
const location = await db.location(
locations.find(l => l.id !== 'bootstrap')!.id,
locations.find(l => l.type !== 'bootstrap')!.id,
);
expect(location).toEqual(output);