* chore(e2e): Add slack message on test failure * chore(e2e): Remove deprecated variable * CR: only run in boundary-ui
123 lines
4.8 KiB
YAML
123 lines
4.8 KiB
YAML
name: Test E2E Desktop Client
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled, opened, synchronize, reopened]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'desktop') }}
|
|
name: Run Desktop E2E Tests
|
|
runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }}
|
|
env:
|
|
ENOS_VAR_boundary_edition: "ent"
|
|
ENOS_VAR_e2e_debug_no_run: true
|
|
SETUP_CLI: true
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up pnpm
|
|
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
|
|
with:
|
|
run_install: false
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
with:
|
|
node-version: 20
|
|
cache: "pnpm"
|
|
cache-dependency-path: |
|
|
pnpm-lock.yaml
|
|
ui/desktop/electron-app/pnpm-lock.yaml
|
|
|
|
- name: Set up Terraform
|
|
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
|
|
|
|
- name: Set up Enos
|
|
uses: hashicorp/action-setup-enos@39a8f388434bea5eeba6649b99aa9949a55a1150
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Vault CLI
|
|
run: |
|
|
wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/vault.zip
|
|
unzip /tmp/vault.zip -d /usr/local/bin
|
|
|
|
- name: Checkout boundary-enterprise
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
repository: hashicorp/boundary-enterprise
|
|
# ref: ${{ github.event.inputs.boundary-enterprise-branch }}
|
|
path: support/src/boundary-enterprise
|
|
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
- name: GH fix for localhost resolution
|
|
run: |
|
|
cat /etc/hosts && echo "-----------"
|
|
sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts
|
|
cat /etc/hosts
|
|
ssh -V
|
|
|
|
echo "127.0.0.1 localhost boundary" | sudo tee -a /etc/hosts
|
|
echo "127.0.0.1 localhost worker" | sudo tee -a /etc/hosts
|
|
echo "127.0.0.1 localhost vault" | sudo tee -a /etc/hosts
|
|
|
|
# TODO: Build image ourselves in case we don't want to use latest?
|
|
- name: Get Boundary docker image
|
|
run: |
|
|
docker pull hashicorp/boundary-enterprise:latest
|
|
docker save hashicorp/boundary-enterprise:latest | gzip > /tmp/boundary-enterprise.zip
|
|
|
|
- name: Set up test infra
|
|
id: infra
|
|
run: |
|
|
ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos
|
|
mkdir -p ./enos/terraform-plugin-cache
|
|
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
|
|
export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \
|
|
export ENOS_VAR_boundary_license="${{ secrets.BOUNDARY_ENT_LICENSE }}" && \
|
|
export ENOS_VAR_boundary_docker_image_file=/tmp/boundary-enterprise.zip && \
|
|
enos scenario launch --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:crt
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pnpm install --frozen-lockfile
|
|
cd e2e-tests
|
|
pnpm playwright install --with-deps
|
|
|
|
# Runner is headless so we need to enable a display to run the client
|
|
- name: Run Tests
|
|
run: |
|
|
source <(bash ./support/src/boundary-enterprise/enos/scripts/test_e2e_env.sh)
|
|
cd e2e-tests
|
|
export DISPLAY=:99
|
|
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
|
|
pnpm run desktop
|
|
|
|
- name: Upload Playwright report
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: playwright-report
|
|
path: e2e-tests/playwright-report
|
|
|
|
- name: Clean up test infra
|
|
if: ${{ always() }}
|
|
run: |
|
|
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
|
|
export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \
|
|
enos scenario destroy --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:crt
|
|
|
|
- name: Send Slack message on failure
|
|
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
|
|
if: ${{ failure() && github.repository == 'hashicorp/boundary-ui' }}
|
|
with:
|
|
method: chat.postMessage
|
|
token: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
payload: |
|
|
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
|
text: ":x: desktop client e2e tests failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Branch:* ${{ github.repository }}:${{ github.event.ref }}"
|