Skip to content

Commit afd92fe

Browse files
authored
API test fix (#44)
* API test fix * Fix the API report issue * Update notify_slack.yml * Fix the slack api error
1 parent a6369e1 commit afd92fe

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
cd /app
4747
if [ -e tests/newman/tide.collection.json ]
4848
then
49-
if [[ ${TEST_NEWMAN_DISABLE_CORE} == true ]]
49+
if [[ "${TEST_NEWMAN_DISABLE_CORE}" == "true" ]]
5050
then
5151
echo "==> Core Tests are disabled by env var TEST_NEWMAN_DISABLE_CORE. Skip the test."
5252
else

.github/workflows/notify_slack.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ jobs:
6060
else
6161
echo TEST_ENVIRONMENTS="*BE URL:* $BE_BASE_URL \n *FE URL:* $FE_BASE_URL" >> $GITHUB_ENV
6262
fi
63+
env:
64+
BE_BASE_URL: ${{ inputs.be_url }}
65+
FE_BASE_URL: ${{ inputs.fe_url }}
66+
- name: prepare-report-api
67+
if: ${{ inputs.test_type == ':postman:' }}
68+
run: |
69+
echo "REPORT_TEXT=API test report is stored in the CI job summary artifacts" >> $GITHUB_ENV
70+
- name: prepare-report-e2e
71+
if: ${{ inputs.test_type != ':postman:' }}
72+
run: |
6373
if [ -f "report-url.txt" -a -s "report-url.txt" ]; then
6474
echo "Workflow status is $WORKFLOW_CONCLUSION"
6575
if [ "$WORKFLOW_CONCLUSION" = "success" ]; then
@@ -70,9 +80,6 @@ jobs:
7080
else
7181
echo "REPORT_TEXT=:crying_cat_face: No report found. Testing may have been skipped." >> $GITHUB_ENV
7282
fi
73-
env:
74-
BE_BASE_URL: ${{ inputs.be_url }}
75-
FE_BASE_URL: ${{ inputs.fe_url }}
7683
- name: sdp-test-report-success
7784
uses: slackapi/[email protected]
7885
if: env.WORKFLOW_CONCLUSION == 'success'
@@ -158,4 +165,4 @@ jobs:
158165
LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
159166
BRANCH_LINK: ${{ github.event.pull_request && github.head_ref || github.ref_name }}
160167
SLACK_BOT_TOKEN: ${{ secrets.TEST_SLACK_BOT_TOKEN }}
161-
ARTIFACTS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
168+
ARTIFACTS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 commit comments

Comments
 (0)