Skip to content

Commit 08be398

Browse files
authored
Merge pull request #392 from dimagi/QA-7819-script-enhancement-jira-ticket-creation-on-failures-for-hq-smoke-test-scripts
QA-7819 PR for email generation to create JIRA ticket along with script fixes
2 parents 6d91290 + 623aa92 commit 08be398

File tree

69 files changed

+1028
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1028
-434
lines changed

.github/workflows/bha-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ jobs:
4747
run: |
4848
echo "Invalid environment: ${{ github.event.client_payload.environment }}"
4949
exit 1
50+
- id: block-india-deploy
51+
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment == 'india' }}
52+
run: |
53+
echo "India environment is not allowed for deployment runs."
54+
exit 1
5055
5156
5257
build:
@@ -61,10 +66,10 @@ jobs:
6166
runs-on: ubuntu-latest
6267
steps:
6368
- uses: actions/checkout@v2
64-
- name: Set up Python 3.9
69+
- name: Set up Python 3.13
6570
uses: actions/setup-python@v2
6671
with:
67-
python-version: 3.9
72+
python-version: 3.13
6873

6974
- name: Install dependencies
7075
run: |

.github/workflows/case-search-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- id: set-matrix-schedule
3131
if: ${{ github.event_name == 'schedule' }}
3232
run: |
33-
echo "::set-output name=matrix::{\"environment\": [\"staging\", \"eu\"]}"
33+
echo "::set-output name=matrix::{\"environment\": [\"staging\"]}"
3434
- id: set-matrix-deploy
3535
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment == 'production' }}
3636
run: |
@@ -48,6 +48,11 @@ jobs:
4848
run: |
4949
echo "Invalid environment: ${{ github.event.client_payload.environment }}"
5050
exit 1
51+
- id: block-india-deploy
52+
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment == 'india' }}
53+
run: |
54+
echo "India environment is not allowed for deployment runs."
55+
exit 1
5156
5257
build:
5358
needs: set_matrix
@@ -61,10 +66,10 @@ jobs:
6166
runs-on: ubuntu-latest
6267
steps:
6368
- uses: actions/checkout@v2
64-
- name: Set up Python 3.9
69+
- name: Set up Python 3.13
6570
uses: actions/setup-python@v2
6671
with:
67-
python-version: 3.9
72+
python-version: 3.13
6873

6974
- name: Install dependencies
7075
run: |

.github/workflows/casesearch-split-screen-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ jobs:
4747
run: |
4848
echo "Invalid environment: ${{ github.event.client_payload.environment }}"
4949
exit 1
50+
- id: block-india-deploy
51+
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment == 'india' }}
52+
run: |
53+
echo "India environment is not allowed for deployment runs."
54+
exit 1
5055
5156
build:
5257
needs: set_matrix
@@ -60,10 +65,10 @@ jobs:
6065
runs-on: ubuntu-latest
6166
steps:
6267
- uses: actions/checkout@v2
63-
- name: Set up Python 3.9
68+
- name: Set up Python 3.13
6469
uses: actions/setup-python@v2
6570
with:
66-
python-version: 3.9
71+
python-version: 3.13
6772

6873
- name: Install dependencies
6974
run: |

.github/workflows/es-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- uses: actions/checkout@v2
51-
- name: Set up Python 3.9
51+
- name: Set up Python 3.13
5252
uses: actions/setup-python@v2
5353
with:
54-
python-version: 3.9
54+
python-version: 3.13
5555

5656
- name: Install dependencies
5757
run: |

.github/workflows/export-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v2
56-
- name: Set up Python 3.9
56+
- name: Set up Python 3.13
5757
uses: actions/setup-python@v2
5858
with:
59-
python-version: 3.9
59+
python-version: 3.13
6060

6161
- name: Install dependencies
6262
run: |
@@ -135,7 +135,7 @@ jobs:
135135
136136
let receivers = '[email protected]'
137137
if (context.eventName !== "pull_request" || context.eventName !== "push") {
138-
138+
139139
}
140140
141141
return {

.github/workflows/form_player.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- uses: actions/checkout@v2
51-
- name: Set up Python 3.9
51+
- name: Set up Python 3.13
5252
uses: actions/setup-python@v2
5353
with:
54-
python-version: 3.9
54+
python-version: 3.13
5555

5656
- name: Install dependencies
5757
run: |

.github/workflows/hq-smoke-tests.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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: |
@@ -96,7 +96,7 @@ jobs:
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 {

.github/workflows/lookup-table.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v2
52-
- name: Set up Python 3.9
52+
- name: Set up Python 3.13
5353
uses: actions/setup-python@v2
5454
with:
55-
python-version: 3.9
55+
python-version: 3.13
5656

5757
- name: Install dependencies
5858
run: |

.github/workflows/multi-select-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
options:
1717
- staging
1818
- production
19+
- eu
1920
schedule:
2021
- cron: '30 7 * * 1-5'
2122

@@ -29,7 +30,7 @@ jobs:
2930
- id: set-matrix-schedule
3031
if: ${{ github.event_name == 'schedule' }}
3132
run: |
32-
echo "::set-output name=matrix::{\"environment\": [\"staging\", \"eu\"]}"
33+
echo "::set-output name=matrix::{\"environment\": [\"staging\"]}"
3334
- id: set-matrix-deploy
3435
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment != 'staging' }}
3536
run: |
@@ -47,6 +48,11 @@ jobs:
4748
run: |
4849
echo "Invalid environment: ${{ github.event.client_payload.environment }}"
4950
exit 1
51+
- id: block-india-deploy
52+
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment == 'india' }}
53+
run: |
54+
echo "India environment is not allowed for deployment runs."
55+
exit 1
5056
5157
build:
5258
needs: set_matrix
@@ -60,10 +66,10 @@ jobs:
6066
runs-on: ubuntu-latest
6167
steps:
6268
- uses: actions/checkout@v2
63-
- name: Set up Python 3.9
69+
- name: Set up Python 3.13
6470
uses: actions/setup-python@v2
6571
with:
66-
python-version: 3.9
72+
python-version: 3.13
6773

6874
- name: Install dependencies
6975
run: |

.github/workflows/ny-cict-robot-framework.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- name: Set up Python 3.9
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v2
2222
with:
23-
python-version: 3.9
23+
python-version: 3.13
2424

2525
- name: Install dependencies
2626
run: |

0 commit comments

Comments
 (0)