Skip to content

try 2 shards

try 2 shards #7

name: Full Suite Test (API + E2E On Venv)

Check failure on line 1 in .github/workflows/full-test-suite.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/full-test-suite.yaml

Invalid workflow file

(Line: 136, Col: 9): A mapping was not expected, (Line: 157, Col: 9): A mapping was not expected
on:
workflow_call:
inputs:
build_image:
type: boolean
required: false
description: This has no effect on this workflow any more, should be remoeved when all services will remove it
default: false
tests_tag:
type: string
required: false
description: Set the e2e-api tests branch tag
default: master
ref:
type: string
required: false
description: Set the venv branch
default: ''
react_version:
type: string
required: false
description: Set the react version
dispatch_id:
type: string
required: false
description: Dispatch id to update status (repo/sha)
secrets:
GH_REPOSITORY_ADMIN_TOKEN:
description: 'Github repository admin token'
required: true
DEV_ARGOCD_PASSWORD:
description: 'ArgoCD password'
required: true
NPM_TOKEN:
description: 'Npm token'
required: true
DOCKER_HUB_ACTION_USER:
description: 'Docker hub user'
required: true
DOCKER_HUB_ACTION_PASSWORD:
description: 'Docker hub password'
required: true
MAILOSAUR_API_KEY:
description: 'MAILOSAUR API KEY'
required: true
MAILOSAUR_SERVER_ID:
description: 'MAILOSAUR SERVER ID'
required: true
MAILOSAUR_SERVER_DOMAIN:
description: 'MAILOSAUR SERVER DOMAIN'
required: true
ZEPHYR_TOKEN:
description: ''
required: true
AZURE_APP_CLIENT_ID:
description: ''
required: true
AZURE_APP_SECRET:
description: ''
required: true
GH_FRONTEGG_BOT_APP_ID:
description: 'Frontegg Bot Creds'
required: true
GH_FRONTEGG_BOT_APP_SECRET:
description: 'Frontegg Bot Creds'
required: true
DD_API_KEY:
description: 'Datadog API Key'
required: true
env:
BUCKET_NAME: "frontegg-test-reports"
AWS_REGION: "us-east-1"
permissions:
id-token: write
contents: read
issues: read
checks: write
pull-requests: write
jobs:
start-venv:
name: Start venv
uses: frontegg/workflows/.github/workflows/start-venv.yaml@master
with:
volatileEnvironment: true
triggerSlack: false
ref: ${{ inputs.ref }}
secrets: inherit
prepare-params:
name: Prepare environment params
runs-on: ubuntu-latest
needs: [ start-venv ]
outputs:
apiUrl: ${{ steps.variables.outputs.apiUrl }}
portalUrl: ${{ steps.variables.outputs.portalUrl }}
environmentId: ${{ steps.variables.outputs.environmentId }}
steps:
- name: prepare output params
id: variables
run: |
echo "environmentId=${{ needs.start-venv.outputs.environmentId }}" >> $GITHUB_OUTPUT
echo "apiUrl=${{ needs.start-venv.outputs.apiUrl }}" >> $GITHUB_OUTPUT
echo "portalUrl=${{ needs.start-venv.outputs.portalUrl }}" >> $GITHUB_OUTPUT
- id: create_bot_token
name: Create bot token
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.GH_FRONTEGG_BOT_APP_ID }}
private_key: ${{ secrets.GH_FRONTEGG_BOT_APP_SECRET }}
- name: "Update trigger status"
uses: frontegg/workflows/.github/shared-actions/update-status@master
if: ${{ inputs.dispatch_id }}
with:
token: ${{ env.BOT_TOKEN }}
dispatch_id: ${{ inputs.dispatch_id }}
description: 'Start tests environment ${{ steps.variables.outputs.apiUrl }}'
run-e2e-test:
name: Run E2E Tests on Venv
needs: [ prepare-params ]
if: |
always() &&
!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master
with:
server_url: ${{ needs.prepare-params.outputs.apiUrl }}
portal_url: ${{ needs.prepare-params.outputs.portalUrl }}
command: |
FRAMEWORK="react" yarn run test:e2e:sanity --shard=${{ matrix.shard }}/${{ matrix.total }}
workflowName: "E2E Tests on Venv"
runs_on: ubuntu-latest-4-cores
strategy:
fail-fast: false
matrix:
total: [ 2 ]
shard: [ 1,2 ]
secrets: inherit
run-api-test:
name: Run API Tests on Venv
needs: [ prepare-params ]
if: |
always() &&
!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master
with:
server_url: ${{ needs.prepare-params.outputs.apiUrl }}
portal_url: ${{ needs.prepare-params.outputs.portalUrl }}
command: |
yarn test:api --shard=${{ matrix.shard }}/${{ matrix.total }}
workflowName: "API Tests on Venv"
runs_on: ubuntu-latest-4-cores
strategy:
fail-fast: false
matrix:
total: [ 2 ]
shard: [ 1,2 ]
secrets: inherit
update-trigger-status:
name: Update trigger status
runs-on: ubuntu-latest
needs: [ run-api-test, run-e2e-test, start-venv, prepare-params ]
if: ${{ always() && inputs.dispatch_id }}
steps:
- id: create_bot_token
name: Create bot token
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.GH_FRONTEGG_BOT_APP_ID }}
private_key: ${{ secrets.GH_FRONTEGG_BOT_APP_SECRET }}
- name: "trigger failure status"
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
uses: frontegg/workflows/.github/shared-actions/update-status@master
with:
token: ${{ env.BOT_TOKEN }}
dispatch_id: ${{ inputs.dispatch_id }}
state: "failure"
description: 'Failed | Api Tests: ${{ needs.run-api-test.result }} | E2E Tests: ${{ needs.run-e2e-test.result }}'
- name: "trigger success status"
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
uses: frontegg/workflows/.github/shared-actions/update-status@master
with:
token: ${{ env.BOT_TOKEN }}
dispatch_id: ${{ inputs.dispatch_id }}
state: "success"
description: 'E2E tests passed'
remove-venv:
name: Remove venv
needs: [ run-api-test, run-e2e-test, start-venv, prepare-params ]
if: |
always() &&
(needs.prepare-params.outputs.environmentId) &&
!contains(needs.run-api-test.result, 'failure') &&
!contains(needs.run-e2e-test.result, 'failure')
uses: frontegg/workflows/.github/workflows/remove-single-venv.yaml@master
with:
venvId: ${{ needs.prepare-params.outputs.environmentId }}
gracePeriodInMinutes: "${{ (needs.start-venv.result == 'failure') && '15' || '0' }}"
secrets:
admin_github_token: ${{ secrets.GH_REPOSITORY_ADMIN_TOKEN }}