184 lines
7.4 KiB
YAML
184 lines
7.4 KiB
YAML
name: Test E2E Desktop Client
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled, opened, synchronize, reopened]
|
|
workflow_dispatch:
|
|
inputs:
|
|
boundary-enterprise-branch:
|
|
description: 'Branch of boundary-enterprise to test against (default to main)'
|
|
required: true
|
|
default: 'main'
|
|
type: string
|
|
boundary-ui-enterprise-branch:
|
|
description: 'Branch of boundary-ui-enterprise to test against (default to main)'
|
|
required: true
|
|
default: 'main'
|
|
type: string
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
# don't need to run e2e tests on ce -> ent merges since tests were already
|
|
# run in the ce branch, and there are currently no code diffferences between
|
|
# the two repos
|
|
if: github.actor != 'hc-github-team-secure-boundary'
|
|
runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }}
|
|
env:
|
|
ENOS_VAR_boundary_edition: "ent"
|
|
ENOS_VAR_e2e_debug_no_run: true
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Set up pnpm
|
|
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 #v6.0.8
|
|
with:
|
|
cache: true
|
|
cache_dependency_path: |
|
|
pnpm-lock.yaml
|
|
ui/desktop/electron-app/pnpm-lock.yaml
|
|
run_install: false
|
|
|
|
- name: Set up Terraform
|
|
uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85
|
|
|
|
- name: Set up Enos
|
|
uses: hashicorp/action-setup-enos@6ec106c8f809fe645162d73bea565c65f3269907
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Vault CLI
|
|
run: |
|
|
wget https://releases.hashicorp.com/vault/1.17.6/vault_1.17.6_linux_amd64.zip -O /tmp/vault.zip
|
|
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then
|
|
unzip -o -q /tmp/vault.zip -d /usr/local/bin
|
|
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
|
|
unzip -o -q /tmp/vault.zip -d "$HOME/bin"
|
|
fi
|
|
|
|
# TODO: We should consider modifying to also build CE binary. For now
|
|
# building ENT binary using most recent UI commit is sufficient.
|
|
- name: Checkout boundary-enterprise
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
repository: hashicorp/boundary-enterprise
|
|
ref: ${{ github.event.inputs.boundary-enterprise-branch || 'main' }}
|
|
path: support/src/boundary-enterprise
|
|
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
- name: Checkout boundary-ui-enterprise
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
repository: hashicorp/boundary-ui-enterprise
|
|
ref: ${{ github.event.inputs.boundary-ui-enterprise-branch || 'main' }}
|
|
path: support/src/boundary-ui-enterprise
|
|
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
- name: Use boundary-ui-enterprise commit SHA for building binary
|
|
run: |
|
|
cd support/src/boundary-ui-enterprise
|
|
git rev-parse HEAD > ../boundary-enterprise/internal/ui/VERSION_ent
|
|
|
|
- name: GH fix for localhost resolution
|
|
run: |
|
|
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then
|
|
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
|
|
fi
|
|
|
|
- name: Set git config
|
|
run: |
|
|
git config --global url."https://oauth2:${{ secrets.ELEVATED_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
|
|
|
|
- name: Determine Go version
|
|
id: get-go-version
|
|
run: |
|
|
echo "Building with Go $(cat ./support/src/boundary-enterprise/.go-version)"
|
|
echo "go-version=$(cat ./support/src/boundary-enterprise/.go-version)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: ${{ steps.get-go-version.outputs.go-version }}
|
|
cache: false
|
|
|
|
- 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_ui_build_override="ent" && \
|
|
export ENOS_VAR_boundary_edition="ent" && \
|
|
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 }}" && \
|
|
enos scenario launch --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:local
|
|
|
|
- name: Move boundary binary
|
|
run: |
|
|
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then
|
|
mv ./support/src/boundary-enterprise/bin/boundary /usr/local/bin/
|
|
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
|
|
mv ./support/src/boundary-enterprise/bin/boundary $HOME/bin
|
|
fi
|
|
boundary version
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pnpm install --frozen-lockfile
|
|
cd e2e-tests
|
|
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then
|
|
pnpm playwright install --with-deps
|
|
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
|
|
# playwright dependencies can't be installed on a self-hosted runner
|
|
# due to permission issues
|
|
pnpm playwright install
|
|
|
|
sudo apt update -qq
|
|
sudo apt install xvfb -y
|
|
fi
|
|
|
|
# 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
|
|
Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
|
|
pnpm run desktop
|
|
|
|
- name: Upload Playwright report
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: playwright-report
|
|
path: e2e-tests/playwright-report
|
|
|
|
- name: Clean up test infra
|
|
if: ${{ always() }}
|
|
continue-on-error: true
|
|
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:local
|
|
|
|
- name: Send Slack message on failure
|
|
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
|
|
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.head_ref || github.ref_name }}"
|