From fd76fdfcb91fef0124da6a9a77e66cf0bd46a1d1 Mon Sep 17 00:00:00 2001 From: John Abrahams Date: Thu, 1 Feb 2024 13:53:33 -0500 Subject: [PATCH 1/2] Move acceptance-test action here, run it during Java project CI workflow --- .github/actions/acceptance-test/action.yml | 64 ++++++++++++++++++++++ .github/workflows/ci.yml | 22 +++++++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 .github/actions/acceptance-test/action.yml diff --git a/.github/actions/acceptance-test/action.yml b/.github/actions/acceptance-test/action.yml new file mode 100644 index 00000000..150c7bf7 --- /dev/null +++ b/.github/actions/acceptance-test/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa15bb6b..f6d8dc8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -27,3 +41,9 @@ jobs: - name: Run Tests run: mvn -U -B -V -ntp verify + + - name: Acceptance tests + if: ${{ inputs.run_acceptance_tests }} + uses: .github/actions/acceptance-test@main + with: + pullimages: missing From e9987e06b3410e5d329c3dbc832b60b09b98fc9c Mon Sep 17 00:00:00 2001 From: John Abrahams Date: Thu, 1 Feb 2024 14:18:22 -0500 Subject: [PATCH 2/2] Need to disable, as GH won't find the action until it's in main --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6d8dc8c..adc2f878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,8 @@ jobs: - name: Run Tests run: mvn -U -B -V -ntp verify - - name: Acceptance tests - if: ${{ inputs.run_acceptance_tests }} - uses: .github/actions/acceptance-test@main - with: - pullimages: missing + # - name: Acceptance tests + # if: ${{ inputs.run_acceptance_tests }} + # uses: eclipse-pass/main/.github/actions/acceptance-test@main + # with: + # pullimages: missing