Skip to content

Commit

Permalink
test(extension): add option to run e2es on staging for split (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljagiela authored Jul 30, 2024
1 parent 60862ba commit bcb9466
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ branches:
- context: block-fixup
- context: Prepare
- context: Unit tests
- context: Smoke tests
- context: Process smoke test reports
- context: >
Run Chromatic check: Core
- context: >
Run Chromatic check: Staking
- context: >
Run Chromatic check: UI
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins:
# Prevent merge commits from being pushed to matching branches
Expand Down
7 changes: 5 additions & 2 deletions .github/shared/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ inputs:
description: 'Banxa`s integration URL'
required: false
default: 'https://lacewallet.banxa-sandbox.com/'
CARDANO_SERVICES_URL_PREPROD:
description: 'Url for preprod env'
required: false

runs:
using: 'composite'
Expand All @@ -52,8 +55,8 @@ runs:
id: check-build-exists
run: |
ART_ID=$(curl -H "Authorization: Bearer ${{ inputs.GITHUB_TOKEN }}" https://api.github.com/repos/input-output-hk/lace/actions/artifacts?name=lace-build-${{ github.sha }} | jq -r .artifacts[0].id)
if [ "$ART_ID" == "null" ]; then
echo "No Lace build artifact found, will build it now"
if ([ "$ART_ID" == "null" ] || [[ "${CARDANO_SERVICES_URL_PREPROD}" == *"staging"* ]]) then
echo "No Lace build artifact found or it is different than dev, will build it now"
echo "build_exists=false" >> $GITHUB_OUTPUT
else
curl -o build_artifact.zip --location "https://api.github.com/repos/input-output-hk/lace/actions/artifacts/${ART_ID}/zip" -H "Authorization: Bearer ${{ inputs.GITHUB_TOKEN }}"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

smokeTestsRun:
smokeTests:
name: Smoke tests run
runs-on: ubuntu-22.04
needs: build_extension
Expand All @@ -162,10 +162,10 @@ jobs:
BATCH: ${{ matrix.batch }}
SMOKE_ONLY: true

smokeTests:
name: Smoke tests
processReports:
name: Process smoke test reports
runs-on: ubuntu-22.04
needs: smokeTestsRun
needs: smokeTests
if: always()
steps:
- name: Download all smoke tests artifacts
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
retention-days: 5

- run: |
if [[ ${{ needs.smokeTestsRun.result }} == "success" ]]; then
if [[ ${{ needs.smokeTests.result }} == "success" ]]; then
exit 0
else
exit 1
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/e2e-tests-linux-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ on:
- chrome
- edge
network:
description: 'network to use'
required: true
default: 'preprod'
type: choice
description: network to use
options:
- preprod
- mainnet
Expand All @@ -35,16 +37,25 @@ on:
description: 'Run only smoke tests'
required: true
default: false
preprod_env:
type: choice
required: true
default: dev
description: 'preprod env to use'
options:
- dev
- staging

run-name: "E2E | os: Linux | browser: ${{ github.event.inputs.browser || 'chrome' }} | network: ${{ github.event.inputs.network || 'preprod' }} | #${{ github.run_number }} | smoke only: ${{ github.event.inputs.smoke_only || false }}"
run-name: "E2E | os: Linux | browser: ${{ github.event.inputs.browser }} | network: ${{ github.event.inputs.network }} | #${{ github.run_number }} | smoke only: ${{ github.event.inputs.smoke_only }} | preprod env: ${{ github.event.inputs.preprod_env }}"

env:
BROWSER: ${{ github.event.inputs.browser || 'chrome' }}
NETWORK: ${{ github.event.inputs.network || 'preprod' }}
BROWSER: ${{ github.event.inputs.browser }}
NETWORK: ${{ github.event.inputs.network }}
RUN: ${{ github.run_number }}
DISPLAY: ':99.0'
NODE_OPTIONS: --max-old-space-size=16384
BRANCH: ${{ github.ref_name }}
PREPROD_ENV: ${{ github.event.inputs.preprod_env }}

jobs:
prereq:
Expand All @@ -68,8 +79,8 @@ jobs:
id: check-build-exists
run: |
ART_ID=$(curl https://api.github.com/repos/input-output-hk/lace/actions/artifacts?name=lace-build-${{ github.sha }} | jq -r .artifacts[0].id)
if [ "$ART_ID" == "null" ]; then
echo "No Lace build artifact found, will build it now"
if ([ "$ART_ID" == "null" ] || [ "${PREPROD_ENV}" != "dev" ]) then
echo "No Lace build artifact found or it is different than dev, will build it now"
echo "build_exists=false" >> $GITHUB_OUTPUT
else
echo "Lace build artifact found no need to build again"
Expand All @@ -81,6 +92,7 @@ jobs:
with:
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CARDANO_SERVICES_URL_PREPROD: "https://${PREPROD_ENV}-preprod.lw.iog.io"

tests-run-split:
if: always()
Expand Down Expand Up @@ -124,6 +136,7 @@ jobs:
browser=${BROWSER}
platform=Linux
smoke_only=${{ needs.prereq.outputs.smoke_only }}
preprod_env=${PREPROD_ENV}
" > environment.properties
- name: Publish allure report to S3
uses: andrcuns/allure-publish-action@v2.6.0
Expand All @@ -142,14 +155,14 @@ jobs:
- name: Add link to summary
run: |
echo "TEST RESULTS:"
echo "https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | smoke only: ${{ needs.prereq.outputs.smoke_only }}" >> $GITHUB_STEP_SUMMARY
echo "https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | smoke only: ${{ needs.prereq.outputs.smoke_only }} | preprod env: ${{ env.PREPROD_ENV }}" >> $GITHUB_STEP_SUMMARY
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2.3.0
if: always()
env:
SLACK_COLOR: "${{ contains(needs.*.result, 'failure') && 'failure' || 'good' }}"
SLACK_ICON_EMOJI: ':lace:'
SLACK_MESSAGE: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | smoke only: ${{ needs.prereq.outputs.smoke_only }}'
SLACK_MESSAGE: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | smoke only: ${{ needs.prereq.outputs.smoke_only }} | preprod env: ${{ env.PREPROD_ENV }}'
SLACK_TITLE: 'Test automation results :rocket:'
SLACK_USERNAME: lace-qa-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Expand Down

0 comments on commit bcb9466

Please sign in to comment.