generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAN-227 - use local integration test work flow file to see why test i…
…n failing in ci
- Loading branch information
1 parent
9596b17
commit c68890e
Showing
2 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Integration tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
node_version_file: | ||
description: "Passed to setup-node action to specify where to source the version of node from" | ||
required: false | ||
type: string | ||
default: ".nvmrc" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
integration_test: | ||
name: Run the integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ inputs.node_version_file }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ${{ inputs.node_version_file }} | ||
- name: download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: npm_build_artifacts | ||
- name: restore cache | ||
id: restore-cache | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: node-modules | ||
with: | ||
path: | | ||
./node_modules | ||
~/.cache/Cypress | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
- name: download the artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: npm_build_artifacts | ||
path: | | ||
build/ | ||
dist/ | ||
assets/stylesheets/ | ||
- name: Get wiremock | ||
shell: bash | ||
run: | | ||
curl -o wiremock.jar https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.9.1/wiremock-standalone-3.9.1.jar | ||
- name: Prepare and run integration tests | ||
id: integration-tests | ||
shell: bash | ||
run: | | ||
nohup java -jar wiremock.jar --port 9091 & | ||
npm run start-feature & | ||
sleep 5 | ||
npm run int-test | ||
# continue-on-error: true | ||
# replacing the above with if: always() | ||
# - name: upload results | ||
# if: always() | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: npm_integration_test_artifacts | ||
# path: | | ||
# integration-tests/videos/ | ||
# integration_tests/screenshots/ | ||
# - name: fail the action if the tests failed | ||
# if: ${{ steps.integration-tests.outcome == 'failure' }} | ||
# uses: actions/github-script@v7 | ||
# with: | ||
# script: | | ||
# core.setFailed('Integration tests failed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters