@@ -66,10 +66,10 @@ jobs:
6666 runs-on : ubuntu-latest
6767 steps :
6868 - uses : actions/checkout@v2
69- - name : Set up Python 3.9
69+ - name : Set up Python 3.13
7070 uses : actions/setup-python@v2
7171 with :
72- python-version : 3.9
72+ python-version : 3.13
7373
7474 - name : Install dependencies
7575 run : |
9696 echo "matrix environment: ${{ matrix.environment }}"
9797 echo "NOW=$(date +'%m-%d %H:%M')" >> $GITHUB_ENV
9898 echo ${{env.NOW}}
99- pytest -v --rootdir= HQSmokeTests/testCases -n 4 --dist=loadfile --reruns 1 --html=report_${{ matrix.environment }}.html
99+ pytest -v --rootdir= HQSmokeTests/testCases -n 4 --dist=loadfile --reruns 1 --reruns-delay 1 -- html=report_${{ matrix.environment }}.html --self-contained-html --json-report --json-report-file=final_failures.json
100100
101101 - name : Parse test counts
102102 id : parse_counts
@@ -119,6 +119,35 @@ jobs:
119119 - name : Fetch artifact ID
120120 run : echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-id }}'
121121
122+ - name : Generate Jira Summary from HTML Report
123+ if : ${{ failure() && github.event_name == 'repository_dispatch' && matrix.environment == 'production' }}
124+ run : |
125+ python3 -c "from common_utilities.fixtures import generate_jira_summary_from_json_report; generate_jira_summary_from_json_report('final_failures.json', 'jira_ticket_body.html')"
126+
127+ - name : Extract JIRA Summary HTML
128+ id : extract_summary
129+ if : ${{ failure() && github.event_name == 'repository_dispatch' && matrix.environment == 'production' }}
130+ run : |
131+ {
132+ echo 'body_html<<EOF'
133+ cat jira_ticket_body.html
134+ echo 'EOF'
135+ } | tee -a "$GITHUB_OUTPUT"
136+
137+
138+ - name : Send Jira Ticket Email
139+ if : ${{ failure() && github.event_name == 'repository_dispatch' && matrix.environment == 'production' }}
140+ uses : dawidd6/action-send-mail@v3
141+ with :
142+ server_address : smtp.gmail.com
143+ server_port : 465
144+ username : ${{ secrets.DIMAGIQA_MAIL_USERNAME }}
145+ password : ${{ secrets.DIMAGIQA_MAIL_PASSWORD }}
146+ subject : " [Smoke Test][${{ matrix.environment }}] Automated Jira Ticket - HQSmokeTest Run #${{ github.run_number }} with ${{ steps.parse_counts.outputs.FAILED }} Test Failure(s)"
147+ 148+ from : <${{ secrets.DIMAGIQA_MAIL_USERNAME }}>
149+ html_body : ${{ steps.extract_summary.outputs.body_html }}
150+ attachments : report_${{ matrix.environment }}.html
122151
123152 - name : Set email vars
124153 if : ${{ failure() }}
@@ -155,7 +184,7 @@ jobs:
155184
156185 let receivers = '[email protected] ' 157186 if (context.eventName !== "pull_request" || context.eventName !== "push") {
158- 187+ 159188 }
160189
161190 return {
0 commit comments