chore(enos): Add scenario for e2e UI tests (#2813)

This commit is contained in:
Michael Li authored and GitHub committed 2023-03-02 14:32:53 -05:00
1 parent 4d19d1cfc4
commit 420952f6b8
9 files changed
+435 -16

No files matched your search

+41 -12
View File
@@ -29,6 +29,7 @@ jobs:
- filter: 'e2e_database'
- filter: 'e2e_static builder:crt'
- filter: 'e2e_static_with_vault builder:crt'
# - filter: 'e2e_ui builder:crt' # Don't run UI tests yet. takes too long.
runs-on: ${{ fromJSON(vars.RUNNER) }}
env:
GITHUB_TOKEN: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }}
@@ -100,15 +101,15 @@ jobs:
cd /tmp/test-deps/pass/password-store-1.7.4
sudo make install
pass init ${{ secrets.ENOS_GPG_UID }}
- name: Download Vault AMD64 binary for integration testing
- name: Download Vault AMD64 binary
if: steps.dep-cache.outputs.cache-hit != 'true'
run: |
wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/test-deps/vault.zip
- name: Install Vault for integration testing
if: matrix.filter == 'e2e_static_with_vault builder:crt' || matrix.filter == 'e2e_database'
- name: Install Vault CLI
if: matrix.filter == 'e2e_static_with_vault builder:crt' || matrix.filter == 'e2e_database' || matrix.filter == 'e2e_ui builder:crt'
run: |
unzip /tmp/test-deps/vault.zip -d /usr/local/bin
- name: Download Linux AMD64 Boundary bundle
- name: Download Boundary Linux AMD64 bundle
id: download
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
@@ -116,15 +117,34 @@ jobs:
path: ./enos/support/downloads
- name: Unzip and rename Boundary bundle
run: |
unzip ${{steps.download.outputs.download-path}}/*.zip -d enos/support
unzip ${{steps.download.outputs.download-path}}/*.zip -d enos/support/boundary
mv ${{steps.download.outputs.download-path}}/*.zip enos/support/boundary.zip
- name: Set up Node.js
uses: actions/setup-node@v3
if: matrix.filter == 'e2e_ui builder:crt'
with:
node-version: '16.x'
- name: Checkout boundary-ui
uses: actions/checkout@v3
if: matrix.filter == 'e2e_ui builder:crt'
with:
repository: hashicorp/boundary-ui
path: enos/support/boundary-ui
- name: Install boundary-ui dependencies
if: matrix.filter == 'e2e_ui builder:crt'
run: yarn --cwd enos/support/boundary-ui install
- name: Install playwright dependencies (i.e. browsers)
if: matrix.filter == 'e2e_ui builder:crt'
run: npx playwright install --with-deps
working-directory: enos/support/boundary-ui
- name: Output Terraform version info
# Use the same env vars from the following step
env:
ENOS_VAR_aws_region: us-east-1
ENOS_VAR_aws_ssh_keypair_name: ${{ github.event.repository.name }}-ci-ssh-key
ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem
ENOS_VAR_local_boundary_dir: ./support/
ENOS_VAR_local_boundary_dir: ./support/boundary
ENOS_VAR_local_boundary_ui_dir: ./support/boundary-ui
ENOS_VAR_crt_bundle_path: ./support/boundary.zip
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
ENOS_VAR_test_email: ${{ secrets.SERVICE_USER_EMAIL }}
@@ -141,7 +161,8 @@ jobs:
ENOS_VAR_aws_region: us-east-1
ENOS_VAR_aws_ssh_keypair_name: ${{ github.event.repository.name }}-ci-ssh-key
ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem
ENOS_VAR_local_boundary_dir: ./support/
ENOS_VAR_local_boundary_dir: ./support/boundary
ENOS_VAR_local_boundary_ui_dir: ./support/boundary-ui
ENOS_VAR_crt_bundle_path: ./support/boundary.zip
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
ENOS_VAR_test_email: ${{ secrets.SERVICE_USER_EMAIL }}
@@ -152,9 +173,15 @@ jobs:
- name: Upload e2e tests output
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-e2e-output.zip
path: enos/test*.out
name: test-e2e-output
path: enos/test*.log
retention-days: 5
- name: Upload e2e UI tests debug info
if: matrix.filter == 'e2e_ui builder:crt' && steps.run.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: test-e2e-ui-debug
path: enos/support/boundary-ui/ui/admin/tests/e2e/artifacts/test-failures
- name: Retry Enos scenario
id: run_retry
if: steps.run.outcome == 'failure'
@@ -162,7 +189,8 @@ jobs:
ENOS_VAR_aws_region: us-east-1
ENOS_VAR_aws_ssh_keypair_name: ${{ github.event.repository.name }}-ci-ssh-key
ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem
ENOS_VAR_local_boundary_dir: ./support/
ENOS_VAR_local_boundary_dir: ./support/boundary
ENOS_VAR_local_boundary_ui_dir: ./support/boundary-ui
ENOS_VAR_crt_bundle_path: ./support/boundary.zip
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
ENOS_VAR_test_email: ${{ secrets.SERVICE_USER_EMAIL }}
@@ -175,14 +203,15 @@ jobs:
ENOS_VAR_aws_region: us-east-1
ENOS_VAR_aws_ssh_keypair_name: ${{ github.event.repository.name }}-ci-ssh-key
ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem
ENOS_VAR_local_boundary_dir: ./support/
ENOS_VAR_local_boundary_dir: ./support/boundary
ENOS_VAR_local_boundary_ui_dir: ./support/boundary-ui
ENOS_VAR_crt_bundle_path: ./support/boundary.zip
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
ENOS_VAR_test_email: ${{ secrets.SERVICE_USER_EMAIL }}
run: |
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
enos scenario destroy --timeout 60m0s --chdir ./enos ${{ matrix.filter }}
- name: Output debug information on failure
- name: Output Enos debug information on failure
if: ${{ failure() }}
run: |
env