From fb42fd490b2f9ce8748413aa79e28c4ee313ce36 Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Thu, 16 Apr 2020 15:49:18 +0200 Subject: [PATCH] wip: trying different things --- .github/workflows/cli.yml | 9 +++++++-- packages/cli/bin/backstage-cli | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 972087ffff..dad8437613 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -20,7 +20,6 @@ jobs: env: CI: true NODE_OPTIONS: --max-old-space-size=4096 - BACKSTAGE_E2E_CLI_TEST: true name: Node ${{ matrix.node-version }} on ${{ matrix.os }} steps: @@ -45,18 +44,22 @@ jobs: # generate temp directory - name: generate tempdir id: generate_tempdir - run: echo ::set-output name=tempdir::$(node scripts/generateTempDir.js) + run: echo "::set-output name=tempdir::$(node scripts/generateTempDir.js)" # This creates a new app and plugin which pollutes the workspace, so it should be run last. - name: verify app and plugin creation on Windows working-directory: ${{ steps.generate_tempdir.outputs.tempdir }} if: runner.os == 'Windows' run: node ${{ github.workspace }}/scripts/cli-e2e-test.js + env: + BACKSTAGE_E2E_CLI_TEST: true - name: verify app and plugin creation on Linux working-directory: ${{ steps.generate_tempdir.outputs.tempdir }} if: runner.os == 'Linux' run: | sudo sysctl fs.inotify.max_user_watches=524288 node ${{ github.workspace }}/scripts/cli-e2e-test.js + env: + BACKSTAGE_E2E_CLI_TEST: true # This should lint and test both an app and a plugin - name: yarn lint, test after creation working-directory: ${{ steps.generate_tempdir.outputs.tempdir }} @@ -64,3 +67,5 @@ jobs: cd test-app yarn lint:all yarn test:all + env: + BACKSTAGE_E2E_CLI_TEST: true diff --git a/packages/cli/bin/backstage-cli b/packages/cli/bin/backstage-cli index 385911896c..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.BACKSTAGE_E2E_CLI_TEST) { +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.