Skip to content

Commit

Permalink
feat: add test workflow and action to run the acceptance tests agains…
Browse files Browse the repository at this point in the history
…t pass docker
  • Loading branch information
jaredgalanis committed Jan 24, 2024
1 parent 5384b9e commit c55ef4e
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/actions/acceptance-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: PASS acceptance tests
description: >
Run acceptance tests.
inputs:
timeouts:
description: 'Testing timeouts (ms)'
default: '60000'
pullimages:
description: 'Image pull policy (always|missing|never) [default: always]'
default: 'always'

runs:
using: composite
steps:
- run: |
echo "Set timeouts: ${{ inputs.timeouts }}"
shell: bash
- name: Append hosts file to enable "pass.local" on localhost
shell: bash
run: echo "127.0.0.1 pass.local" | sudo tee -a /etc/hosts

- name: Checkout pass-docker
uses: actions/checkout@v3
with:
repository: eclipse-pass/pass-docker
path: pass-docker

- name: Checkout pass-acceptance-testing
uses: actions/checkout@v3
with:
repository: eclipse-pass/pass-acceptance-testing
path: pass-acceptance-testing

- name: Run pass-docker
shell: bash
working-directory: pass-docker
run: docker compose -f docker-compose.yml -f eclipse-pass.local.yml up -d --no-build --quiet-pull --pull ${{ inputs.pullimages }}

- name: Run acceptance tests
shell: bash
working-directory: pass-acceptance-testing
run: |
yarn install --frozen-lockfile
npx testcafe \
'chrome:headless --ignore-certificate-errors --allow-insecure-localhost' \
--hostname localhost \
tests/*Tests.js \
--selector-timeout ${{ inputs.timeouts}} \
--assertion-timeout ${{ inputs.timeouts}} \
--ajax-request-timeout ${{ inputs.timeouts}}
- name: Stop pass-docker
if: always()
shell: bash
working-directory: pass-docker
run: docker compose -f docker-compose.yml -f eclipse-pass.local.yml down -v
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

env:
TIMEOUT_LENGTH: 120000

jobs:
run_acceptance_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout pass-acceptance-testing
uses: actions/checkout@v3

- name: Run acceptance tests
uses: ./.github/actions/acceptance-test
with:
timeouts: $TIMEOUT_LENGTH

0 comments on commit c55ef4e

Please sign in to comment.