Skip to content

Commit f1ca919

Browse files
authored
upload ut_failure_list.csv as artifacts (#1691)
Upload a failure list as artifacts, the artifacts will be used by triage bot to find similar issue already reported.
1 parent 39fa9c5 commit f1ca919

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/scripts/check-ut.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_message(case):
8787

8888
return " ; ".join(error_messages) if error_messages else f"{case.result[0].message.splitlines()[0]}"
8989

90-
def print_md_row(row, print_header=False):
90+
def print_md_row(row, print_header=False, failure_list=None):
9191
if print_header:
9292
header = " | ".join([f"{key}" for key in row.keys()])
9393
print(f"| {header} |")
@@ -96,7 +96,11 @@ def print_md_row(row, print_header=False):
9696
row_values = " | ".join([f"{value}" for value in row.values()])
9797
print(f"| {row_values} |")
9898

99-
def print_failures():
99+
if failure_list is not None:
100+
failure_list.write(f"| {row_values} |\n")
101+
102+
103+
def print_failures(failure_list=None):
100104
if not failures:
101105
return
102106

@@ -109,7 +113,7 @@ def print_failures():
109113
'Status': get_result(case),
110114
'Message': get_message(case),
111115
'Source': case['source'] if isinstance(case, dict) else 'XML'
112-
}, print_header)
116+
}, print_header, failure_list=failure_list)
113117
print_header = False
114118

115119
def parse_log_file(log_file):
@@ -251,7 +255,8 @@ def main():
251255
else:
252256
print(f"Skipping unknown file type: {input_file}", file=sys.stderr)
253257

254-
print_failures()
258+
with open("ut_failure_list.csv", "w") as failure_list:
259+
print_failures(failure_list=failure_list)
255260
print_summary()
256261

257262

.github/workflows/_linux_ut.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ jobs:
295295
source activate xpu_op_${ZE_AFFINITY_MASK}
296296
pip install junitparser
297297
python .github/scripts/check-ut.py ${{ github.workspace }}/ut_log/*.xml >> $GITHUB_STEP_SUMMARY || true
298+
if [ -e "ut_failure_list.csv" ];then
299+
cp ut_failure_list.csv ${{ github.workspace }}/ut_log/ut_failure_list.csv
300+
fi
298301
- name: UT Test Results Check
299302
shell: bash
300303
run: |
@@ -325,7 +328,13 @@ jobs:
325328
with:
326329
name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-${{ env.UT_NAME }}
327330
path: ${{ github.workspace }}/ut_log
328-
331+
- name: Upload XPU UT Failure list
332+
if: always()
333+
uses: actions/upload-artifact@v4
334+
with:
335+
name: XPU-UT-Failure-List-${{ github.event.pull_request.number || github.sha }}-${{ env.UT_NAME }}
336+
path: ${{ github.workspace }}/ut_log/ut_failure_list.csv
337+
329338
distributed_ut_test:
330339
runs-on: pvc_e2e
331340
if: contains(inputs.ut, 'xpu_distributed')

0 commit comments

Comments
 (0)