Skip to content
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

Updated nightwatch workflow inputs and added Estuary app to trigger workflow #1319

Merged
merged 7 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 18 additions & 25 deletions .github/workflows/nightwatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,33 @@ name: dpc-sdp/ripple/nightwatch
on:
workflow_dispatch:
inputs:
e2e:
type: boolean
required: true
e2e_project:
project:
type: string
required: true
e2e_be_url:
be_url:
type: string
e2e_fe_url:
fe_url:
type: string
jobs:
e2e_be:
if: inputs.e2e
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_be.yml@main
secrets: inherit
with:
tags: "(@core or @${{ inputs.e2e_project }}) and @regression"
be_url: ${{ inputs.e2e_be_url }}
project: ${{ inputs.e2e_project }}
tags: "(@core or @${{ inputs.project }}) and @regression"
be_url: ${{ inputs.be_url }}
project: ${{ inputs.project }}
browser: 'chrome'
test_id: 'fixture'
test_type: ':nightwatch:'
runner: 'ubuntu-latest'
e2e_fe_smoke:
if: inputs.e2e
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main
secrets: inherit
with:
tags: "(@smoke and @core) or (@smoke and @${{ inputs.e2e_project }})"
be_url: ${{ inputs.e2e_be_url }}
fe_url: ${{ inputs.e2e_fe_url }}
project: ${{ inputs.e2e_project }}
tags: "(@smoke and @core) or (@smoke and @${{ inputs.project }})"
be_url: ${{ inputs.be_url }}
fe_url: ${{ inputs.fe_url }}
project: ${{ inputs.project }}
browser: 'chrome'
test_id: 'fixture'
test_type: ':nightwatch:'
Expand All @@ -42,14 +37,13 @@ jobs:
needs:
- e2e_be
- e2e_fe_smoke
if: inputs.e2e
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main
secrets: inherit
with:
tags: "(@core or @${{ inputs.e2e_project }}) and @regression and not @mobile"
be_url: ${{ inputs.e2e_be_url }}
fe_url: ${{ inputs.e2e_fe_url }}
project: ${{ inputs.e2e_project }}
tags: "(@core or @${{ inputs.project }}) and @regression and not @mobile"
be_url: ${{ inputs.be_url }}
fe_url: ${{ inputs.fe_url }}
project: ${{ inputs.project }}
browser: 'chrome'
test_id: 'fixture'
test_type: ':nightwatch:'
Expand All @@ -58,14 +52,13 @@ jobs:
needs:
- e2e_be
- e2e_fe_smoke
if: inputs.e2e
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main
secrets: inherit
with:
tags: "(@core or @${{ inputs.e2e_project }}) and @regression and not @desktop"
be_url: ${{ inputs.e2e_be_url }}
fe_url: ${{ inputs.e2e_fe_url }}
project: ${{ inputs.e2e_project }}
tags: "(@core or @${{ inputs.project }}) and @regression and not @desktop"
be_url: ${{ inputs.be_url }}
fe_url: ${{ inputs.fe_url }}
project: ${{ inputs.project }}
browser: 'androidChrome'
test_id: 'fixture'
test_type: ':nightwatch:'
Expand Down
32 changes: 15 additions & 17 deletions scripts/trigger-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,18 @@ else
}'
fi

if [ -z $E2E_GITHUB_TOKEN ]; then
echo "Error: No E2E GitHub token found, end to end is not triggered. Please make sure E2E_GITHUB_TOKEN is set up."
else
# Trigger GitHub Action to run the workflow
curl --location --request POST "https://api.github.com/repos/dpc-sdp/ripple/actions/workflows/nightwatch.yml/dispatches" \
--header "Authorization: Bearer $E2E_GITHUB_TOKEN" \
--header 'Accept: application/vnd.github+json' \
--data-raw '{
"ref": "'"$BRANCH"'",
"inputs": {
"e2e": true,
"e2e_be_url": "'"$BE_URL"'",
"e2e_fe_url": "'"$FE_URL"'",
"e2e_project": "reference"
}
}'
fi
E2E_ESTUARY_URL="${E2E_ESTUARY_URL:-http://estuary.sdp-services:8080/v1/actions/trigger-e2e}"
E2E_ESTUARY_TOKEN_PATH="${E2E_ESTUARY_TOKEN_PATH:-/run/secrets/kubernetes.io/serviceaccount/token}"
# Trigger GitHub Action to run the nightwatch workflow via estuary
curl --location --request POST "$E2E_ESTUARY_URL" \
--header "Authorization: Bearer $(cat $E2E_ESTUARY_TOKEN_PATH)" \
--header "Content-Type: application/json" \
--data-raw '{
"owner": "dpc-sdp",
"repo": "ripple",
"workflow": "nightwatch.yml",
"ref": "'"$BRANCH"'",
"be_url": "'"$BE_URL"'",
"fe_url": "'"$FE_URL"'",
"project": "reference"
}'