Skip to content

Commit

Permalink
Jupyter test slack report update (#47)
Browse files Browse the repository at this point in the history
* updated workflow to send slack report as single message

* test msg

* update

* fix

* Update uat_associations.txt with new collections

* test

* removed collection

* test

* added env variable name

* test

* remvoed -e

* Update uat_associations.txt with new collections

* removed http to disable preview

* Update uat_associations.txt with new collections

* updated to final version

Co-authored-by: Zoltan Miskolci <zoltan.miskolci@jpl.nasa.gov>
Co-authored-by: Phoeneix <Phoeneix@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 15, 2022
1 parent 72f0b8d commit e15f5d9
Showing 1 changed file with 28 additions and 46 deletions.
74 changes: 28 additions & 46 deletions .github/workflows/jupyter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
echo "OPS_SUCCESS_FILE=ops_success.txt" >> $GITHUB_ENV
echo "UAT_FAILURE_FILE=uat_fail.txt" >> $GITHUB_ENV
echo "OPS_FAILURE_FILE=ops_fail.txt" >> $GITHUB_ENV
echo "SLACK_REPORT_CONTENT=" >> $GITHUB_ENV
- name: Set environment variables for notebook
run: |
echo "OPS_USERNAME=${{ secrets.EDL_USER }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -84,61 +85,42 @@ jobs:
echo "Success Content: $(cat ${{ env.OUTPUT_DIR }}/${{ env.OPS_SUCCESS_FILE }} | sed 's/$/,/' | tr '\n' ' ')"
echo
echo "Failed Content: $(cat ${{ env.OUTPUT_DIR }}/${{ env.OPS_FAILURE_FILE }} | sed 's/$/,/' | tr '\n' ' ')"
- name: Send report for UAT check - SUCCESS
uses: slackapi/slack-github-action@v1.21.0
- name: Slack Report update - Add info for UAT check - SUCCESS
if: |
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test UAT result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.SUCCESS_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for UAT check - FAILURE
uses: slackapi/slack-github-action@v1.21.0
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test UAT result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.SUCCESS_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add info for UAT check - FAILURE
if: |
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for OPS check - SUCCESS
uses: slackapi/slack-github-action@v1.21.0
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n" >> $GITHUB_ENV
${{ env.SLACK_REPORT_CONTENT }} += "Jupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n"
- name: Slack Report update - Add info for OPS check - SUCCESS
if: |
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test OPS result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.SUCCESS_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for OPS check - FAILURE
uses: slackapi/slack-github-action@v1.21.0
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test OPS result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.SUCCESS_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add info for OPS check - FAILURE
if: |
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test OPS result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.FAIL_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Add link to slack report
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test OPS result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.FAIL_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add action link on Failure
if: |
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nExecution link:\ngithub.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
echo ${{ env.SLACK_REPORT_CONTENT }}
- name: Send Report to Slack
uses: slackapi/slack-github-action@v1.21.0
if: |
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true' ||
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
env.SLACK_REPORT_CONTENT != ''
with:
payload: |
{
"status": "Execution link:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"status": "${{ env.SLACK_REPORT_CONTENT }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
Expand Down

0 comments on commit e15f5d9

Please sign in to comment.