chore: use the e2e test method for building uffizi containers
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -28,7 +28,7 @@ jobs:
|
||||
- name: backstage create-app | delete if already exists
|
||||
run: |
|
||||
rm -rf ./example-app
|
||||
npx @backstage/create-app
|
||||
node ./packages/e2e-test/.bin/e2e-test create -o ./example-app
|
||||
env:
|
||||
BACKSTAGE_APP_NAME: example-app
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
*/
|
||||
|
||||
import { Command } from 'commander';
|
||||
import { run } from './run';
|
||||
import { run, create } from './run';
|
||||
|
||||
export function registerCommands(program: Command) {
|
||||
program.command('run').description('Run e2e tests').action(run);
|
||||
program.command('create').option('-o, --output <path>').action(create);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,24 @@ const templatePackagePaths = [
|
||||
'packages/create-app/templates/default-app/packages/backend/package.json.hbs',
|
||||
];
|
||||
|
||||
export async function create({ output }: { output: string }) {
|
||||
const outputDir = resolvePath(process.cwd(), output);
|
||||
|
||||
const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-'));
|
||||
print(`CLI E2E test root: ${rootDir}\n`);
|
||||
|
||||
print('Building dist workspace');
|
||||
const workspaceDir = await buildDistWorkspace('workspace', rootDir);
|
||||
|
||||
// // Otherwise yarn will refuse to install with CI=true
|
||||
process.env.YARN_ENABLE_IMMUTABLE_INSTALLS = 'false';
|
||||
|
||||
print('Creating a Backstage App');
|
||||
const appDir = await createApp('test-app', workspaceDir, rootDir);
|
||||
|
||||
await fs.move(appDir, outputDir, { overwrite: true });
|
||||
}
|
||||
|
||||
export async function run() {
|
||||
const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-'));
|
||||
print(`CLI E2E test root: ${rootDir}\n`);
|
||||
|
||||
Reference in New Issue
Block a user