From e2f2bbce38a9a62262d15aaf0622ecba41f98375 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 22 Dec 2022 11:40:58 +0100 Subject: [PATCH] Remove tugboat workflow Signed-off-by: Johan Haals --- .github/workflows/verify_e2e-tugboat.yml | 131 -------------------- .tugboat/config.yml | 17 --- .tugboat/tugboat.app-config.production.yaml | 10 -- cypress/README.md | 4 - 4 files changed, 162 deletions(-) delete mode 100644 .github/workflows/verify_e2e-tugboat.yml delete mode 100644 .tugboat/config.yml delete mode 100644 .tugboat/tugboat.app-config.production.yaml diff --git a/.github/workflows/verify_e2e-tugboat.yml b/.github/workflows/verify_e2e-tugboat.yml deleted file mode 100644 index cb3a463a0d..0000000000 --- a/.github/workflows/verify_e2e-tugboat.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: E2E Test Tugboat -on: deployment_status - -jobs: - set-pending: - if: github.event.deployment_status.state != 'success' && github.event.deployment_status.state != 'failed' - name: Set pending waiting for Tugboat - runs-on: ubuntu-latest - steps: - # Set an initial commit status message to indicate that the tests are - # running. - - name: set pending status - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} - debug: true - script: | - return github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: 'pending', - context: 'Backstage Tugboat E2E Tests', - description: 'Waiting for Tugboat to complete deployment', - target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" - }); - - run-tests: - # Only run after a successful Tugboat deployment. - if: github.event.deployment_status.state == 'success' - name: Run tests against Tugboat deployment - runs-on: ubuntu-latest - steps: - # Set an initial commit status message to indicate that the tests are - # running. - - name: set pending status - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} - debug: true - script: | - return github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: 'pending', - context: 'Backstage Tugboat E2E Tests', - description: 'Running against tugboat preview', - target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" - }); - - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '16.x' - - - name: yarn install - run: yarn --cwd cypress install - - # This is required because the environment_url param that Tugboat uses - # to tell us where the preview is located isn't supported unless you - # specify the custom Accept header when getting the deployment_status, - # and GitHub actions doesn't do that by default. So instead we have to - # load the status object manually and get the data we need. - # https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/ - - name: get deployment status - id: get-status-env - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} - result-encoding: string - script: | - const result = await github.rest.repos.getDeploymentStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - deployment_id: context.payload.deployment.id, - status_id: context.payload.deployment_status.id, - headers: { - 'Accept': 'application/vnd.github.ant-man-preview+json' - }, - }); - console.log(result); - return result.data.environment_url; - - - name: cypress run - uses: cypress-io/github-action@v2 - env: - CYPRESS_baseUrl: ${{steps.get-status-env.outputs.result}} - with: - config-file: ./cypress.json - working-directory: ./cypress - browser: chrome - install: false - headless: true - - - name: update artifact - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: cypress-videos - path: ./cypress/cypress/videos - - - name: set status - if: ${{ failure() }} - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} - script: | - return github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: "error", - context: 'Backstage Tugboat E2E Tests', - target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" - }); - - - name: set status - if: ${{ success() }} - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} - script: | - return github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: "success", - context: 'Backstage Tugboat E2E Tests', - target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" - }); diff --git a/.tugboat/config.yml b/.tugboat/config.yml deleted file mode 100644 index 1d06e39152..0000000000 --- a/.tugboat/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -services: - backstage: - image: tugboatqa/node:lts - expose: 7007 - default: true - commands: - init: - - mkdir -p /etc/service/node - - echo "#!/bin/sh" > /etc/service/node/run - - echo "yarn --cwd ${TUGBOAT_ROOT} start-backend --config ${TUGBOAT_ROOT}/app-config.yaml --config ${TUGBOAT_ROOT}/.tugboat/tugboat.app-config.production.yaml" >> /etc/service/node/run - - chmod +x /etc/service/node/run - build: - - yarn install --immutable - - yarn workspace example-app build - start: - # wget the endpoint. Will retry every 2 seconds. 30 retries = 1m for service to come up. Plenty. - - wget -O /dev/null -o /dev/null --tries=30 --timeout=5 --retry-connrefused http://localhost:7007 diff --git a/.tugboat/tugboat.app-config.production.yaml b/.tugboat/tugboat.app-config.production.yaml deleted file mode 100644 index b264d53f3f..0000000000 --- a/.tugboat/tugboat.app-config.production.yaml +++ /dev/null @@ -1,10 +0,0 @@ -app: - title: Backstage Tugboat Preview - baseUrl: ${TUGBOAT_DEFAULT_SERVICE_URL} - -backend: - baseUrl: ${TUGBOAT_DEFAULT_SERVICE_URL} - cors: - origin: ${TUGBOAT_DEFAULT_SERVICE_URL} - methods: [GET, POST, PUT, DELETE] - credentials: true diff --git a/cypress/README.md b/cypress/README.md index 4212af398c..be2960e63c 100644 --- a/cypress/README.md +++ b/cypress/README.md @@ -2,10 +2,6 @@ Hey 👋 Welcome to the Cypress tests for Backstage. They're designed to be run against the `packages/app` folder in the main repo, and be some form of smoke tests to make sure that we don't break any core functionality. -They run part of the PR build, and are triggered from the `.github/workflows/tugboat.yml` file. - -The main app gets built up part of a [Tugboat Build](https://tugboat.qa), which when complete, sends a `deployment event` to the PR triggering the aforementioned workflow. - ### Running Locally In order to make typescript happy, this `cypress` package is separate from all the Jest dependencies in the monorepo workspaces setup.