From 3eca6cc9d5cf83e4e8104a6f8738031b49327362 Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Thu, 16 Apr 2020 15:00:21 +0200 Subject: [PATCH] Change name of env variable used in script --- packages/cli/bin/backstage-cli | 5 +---- packages/cli/src/commands/build-cache/index.ts | 2 +- packages/cli/src/commands/create-app/createApp.ts | 2 +- scripts/cli-e2e-test.js | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/cli/bin/backstage-cli b/packages/cli/bin/backstage-cli index 1cdf8c81af..5288f913d9 100755 --- a/packages/cli/bin/backstage-cli +++ b/packages/cli/bin/backstage-cli @@ -20,10 +20,7 @@ const path = require('path'); // Figure out whether we're running inside the backstage repo or as an installed dependency const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src')); -// This is used for e2e-tests where we create a new app in a tmp folder -const isTemp = path.resolve(__dirname).includes(require('os').tmpdir()); - -if (!isLocal || isTemp || process.env.E2E) { +if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) { // src-relative imports are a pain to get to work with plain tsc compilation, as the // transpiled code will maintain the imports as they are in the source. Which means an // import for `helpers/paths` will start like that in the output, which won't work in NodeJS. diff --git a/packages/cli/src/commands/build-cache/index.ts b/packages/cli/src/commands/build-cache/index.ts index 368fac2593..a825a7f415 100644 --- a/packages/cli/src/commands/build-cache/index.ts +++ b/packages/cli/src/commands/build-cache/index.ts @@ -30,7 +30,7 @@ export async function withCache( buildFunc: () => Promise, ): Promise { const key = await Cache.readInputKey(options.inputs); - if (!key || process.env.E2E) { + if (!key || process.env.BACKSTAGE_E2E_CLI_TEST) { print('input directory is dirty, skipping cache'); await fs.remove(options.output); await buildFunc(); diff --git a/packages/cli/src/commands/create-app/createApp.ts b/packages/cli/src/commands/create-app/createApp.ts index 475c9d7cdc..219406704d 100644 --- a/packages/cli/src/commands/create-app/createApp.ts +++ b/packages/cli/src/commands/create-app/createApp.ts @@ -155,7 +155,7 @@ export default async () => { await moveApp(tempDir, appDir, answers.name); // e2e testing needs special treatment - if (process.env.E2E) { + if (process.env.BACKSTAGE_E2E_CLI_TEST) { Task.section('Linking packages locally for e2e tests'); const rootDir = process.env.CI ? resolvePath(process.env.GITHUB_WORKSPACE!) diff --git a/scripts/cli-e2e-test.js b/scripts/cli-e2e-test.js index 934585bee5..d67154537e 100644 --- a/scripts/cli-e2e-test.js +++ b/scripts/cli-e2e-test.js @@ -32,7 +32,7 @@ const generateTempDir = require('./generateTempDir.js'); Browser.localhost('localhost', 3000); async function main() { - process.env.E2E = 'true'; + process.env.BACKSTAGE_E2E_CLI_TEST = 'true'; const rootDir = process.env.CI ? resolvePath(process.env.GITHUB_WORKSPACE)