-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/ccm 14778 fix e2 e tests #534
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
Open
stevebux
wants to merge
2
commits into
main
Choose a base branch
from
feature/CCM-14778-Fix-E2E-Tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,38 @@ | ||
| name: Acceptance tests - component | ||
| description: "Run component acceptance tests for this repo" | ||
|
|
||
| inputs: | ||
| testType: | ||
| description: Type of test to run | ||
| required: true | ||
|
|
||
| targetEnvironment: | ||
| description: Name of the environment under test | ||
| required: true | ||
|
|
||
| targetComponent: | ||
| description: Name of the component under test | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
|
|
||
| steps: | ||
|
|
||
| - name: Fetch terraform output | ||
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5 | ||
| with: | ||
| name: terraform-output-${{ inputs.targetComponent }} | ||
|
|
||
| - name: Get Node version | ||
| id: nodejs_version | ||
| shell: bash | ||
| run: | | ||
| echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Run test - ${{ inputs.testType }} | ||
| shell: bash | ||
| env: | ||
| TARGET_ENVIRONMENT: ${{ inputs.targetEnvironment }} | ||
| run: | | ||
| make test-${{ inputs.testType }} |
This file contains hidden or 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,79 @@ | ||
| name: Acceptance tests - e2e | ||
| description: "Run e2e acceptance tests for this repo" | ||
|
|
||
| inputs: | ||
| targetEnvironment: | ||
| description: Name of the environment under test | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
|
|
||
| steps: | ||
| - name: "Set PR NUMBER" | ||
| id: set_pr_number | ||
| shell: bash | ||
| run: | | ||
| env="${{ inputs.targetEnvironment }}" | ||
| if [[ "$env" == main ]]; then | ||
| echo "pr_number=" >> $GITHUB_OUTPUT | ||
| elif [[ "$env" == pr* ]]; then | ||
| echo "pr_number=${env#pr}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "pr_number=$env" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Determine if proxy has been deployed | ||
| id: check_proxy_deployed | ||
| env: | ||
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ steps.set_pr_number.outputs.pr_number }} | ||
| shell: bash | ||
| run: | | ||
| if [[ -z "$PR_NUMBER" ]]; then | ||
| echo "No pull request detected; proxy was deployed." | ||
| echo "proxy_deployed=true" >> $GITHUB_OUTPUT | ||
| exit 0 | ||
| fi | ||
|
|
||
| branch_name=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')} | ||
|
|
||
| labels=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name') | ||
| echo "Labels on PR #$PR_NUMBER: $labels" | ||
|
|
||
| if echo "$labels" | grep -Fxq 'deploy-proxy'; then | ||
| echo "proxy_deployed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "proxy_deployed=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Install poetry and e2e test dependencies | ||
| if: ${{ steps.check_proxy_deployed.outputs.proxy_deployed == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| pipx install poetry | ||
| cd tests/e2e-tests && poetry install | ||
|
|
||
| - name: Run tests | ||
| if: ${{ steps.check_proxy_deployed.outputs.proxy_deployed == 'true' }} | ||
| shell: bash | ||
| env: | ||
| TARGET_ENVIRONMENT: ${{ inputs.targetEnvironment }} | ||
| PR_NUMBER: ${{ steps.set_pr_number.outputs.pr_number }} | ||
| run: | | ||
| echo "$SUPPLIER_API_PRIVATE_KEY" > "${GITHUB_WORKSPACE}/internal-dev-test-1.pem" | ||
| chmod 600 "${GITHUB_WORKSPACE}/internal-dev-test-1.pem" | ||
| BASE_PROXY_NAME=nhs-notify-supplier--internal-dev--nhs-notify-supplier | ||
|
|
||
| export API_ENVIRONMENT=internal-dev | ||
| if [[ -z "$PR_NUMBER" ]]; then | ||
| export PROXY_NAME="${BASE_PROXY_NAME}" | ||
| export NON_PROD_API_KEY="${APIM_API_KEY}" | ||
| else | ||
| export PROXY_NAME="${BASE_PROXY_NAME}-PR-${PR_NUMBER}" | ||
| export NON_PROD_API_KEY="${APIM_PR_API_KEY}" | ||
| fi | ||
|
|
||
| export STATUS_ENDPOINT_API_KEY="${APIM_STATUS_API_KEY}" | ||
| export NON_PROD_PRIVATE_KEY="${GITHUB_WORKSPACE}/internal-dev-test-1.pem" | ||
| make .internal-dev-test | ||
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| [ | ||
| "component", | ||
| "e2e", | ||
| "sandbox" | ||
| ] |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.