Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move acceptance-test action to main #889

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/actions/acceptance-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: PASS acceptance tests
description: Run pass-acceptance-tests

# TODO: Would be nice to allow replacement images

inputs:
timeouts:
description: 'Testing timeouts (ms)'
default: '60000'

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

# Show both views to see which images are in use by docker compose but with extra info like time created from docker
- name: Print Docker images
shell: bash
working-directory: pass-docker
run: |
docker images
docker compose images

- 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
22 changes: 21 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
name: main Continuous Integration
on: [pull_request, workflow_dispatch, workflow_call]

on:
pull_request:
workflow_dispatch:
inputs:
run_acceptance_tests:
description: Should acceptance tests be run?
type: boolean
default: true
workflow_call:
inputs:
run_acceptance_tests:
description: Should acceptance tests be run?
type: boolean
default: true

concurrency:
group: ci-${{ github.head_ref || github.ref }}
Expand Down Expand Up @@ -27,3 +41,9 @@ jobs:

- name: Run Tests
run: mvn -U -B -V -ntp verify

# - name: Acceptance tests
# if: ${{ inputs.run_acceptance_tests }}
# uses: eclipse-pass/main/.github/actions/acceptance-test@main
# with:
# pullimages: missing
Loading