Skip to content

Commit 30a820f

Browse files
[CI] Enable checking the new passed cases (#1930)
- Highlight the new passed cases in known issue list
1 parent 0760724 commit 30a820f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/scripts/ut_result_check.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,28 @@ compare_and_filter_logs() {
8282
rm -f ${temp_output} ${temp_file} ${temp_final}
8383
}
8484

85+
check_passed_known_issues() {
86+
local file_passed_UT="$1"
87+
local file_known_issue="$2"
88+
local output_file="${3:-${file_passed_UT%.*}_passed_known_issues.log}"
89+
90+
if [[ $# -lt 2 ]]; then
91+
echo "[ERROR] Need 2 files to compare"
92+
return 1
93+
fi
94+
95+
echo "Checking for known issues that are now passing in $file_passed_UT"
96+
grep -Fxf "$file_passed_UT" "$file_known_issue" > "$output_file"
97+
98+
echo -e "\n\033[1;32m[New passed cases Summary]\033[0m"
99+
if [[ -s "$output_file" ]]; then
100+
cat "$output_file"
101+
echo -e "\n\033[1;32mTotal: $(wc -l < "$output_file") known issues are now passing\033[0m"
102+
else
103+
echo -e "\033[1;33mNo known issues are now passing\033[0m"
104+
fi
105+
}
106+
85107
if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' ]]; then
86108
grep -E "FAILED" "${ut_suite}"_test.log | awk '{print $1}' | grep -v "FAILED" > ./"${ut_suite}"_failed.log
87109
grep -E "have failures" "${ut_suite}"_test.log | awk '{print $1}' >> ./"${ut_suite}"_failed.log
@@ -95,6 +117,10 @@ if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1'
95117
echo -e "Checking Failed cases in ${ut_suite}"
96118
echo -e "========================================================================="
97119
compare_and_filter_logs "${ut_suite}"_failed.log Known_issue.log
120+
echo -e "========================================================================="
121+
echo -e "Checking New passed cases in Known issue list for ${ut_suite}"
122+
echo -e "========================================================================="
123+
check_passed_known_issues "${ut_suite}"_passed.log Known_issue.log
98124
if [[ -f "${ut_suite}_failed_filtered.log" ]]; then
99125
num_failed=$(wc -l < "./${ut_suite}_failed_filtered.log")
100126
else
@@ -112,9 +138,11 @@ if [[ "${ut_suite}" == 'op_ut' ]]; then
112138
grep -E "FAILED" op_ut_with_skip_test.log | awk '{print $1}' | grep -v "FAILED" > ./"${ut_suite}"_with_skip_test_failed.log
113139
grep -E "have failures" op_ut_with_skip_test.log | awk '{print $1}' >> ./"${ut_suite}"_with_skip_test_failed.log
114140
grep -E "Timeout" op_ut_with_skip_test.log | grep "test" >> ./"${ut_suite}"_with_skip_test_failed.log
141+
grep "PASSED" op_ut_with_skip_test.log | awk '{print $1}' > ./"${ut_suite}"_with_skip_test_passed.log
115142
grep -E "FAILED" op_ut_with_only_test.log | awk '{print $1}' | grep -v "FAILED" > ./"${ut_suite}"_with_only_test_failed.log
116143
grep -E "have failures" op_ut_with_only_test.log | awk '{print $1}' >> ./"${ut_suite}"_with_only_test_failed.log
117144
grep -E "Timeout" op_ut_with_only_test.log | grep "test" >> ./"${ut_suite}"_with_only_test_failed.log
145+
grep "PASSED" op_ut_with_only_test.log | awk '{print $1}' > ./"${ut_suite}"_with_only_test_passed.log
118146
echo -e "========================================================================="
119147
echo -e "Show Failed cases in ${ut_suite} with skip"
120148
echo -e "========================================================================="
@@ -123,6 +151,10 @@ if [[ "${ut_suite}" == 'op_ut' ]]; then
123151
echo -e "Checking Failed cases in ${ut_suite} with skip"
124152
echo -e "========================================================================="
125153
compare_and_filter_logs "${ut_suite}"_with_skip_test_failed.log Known_issue.log
154+
echo -e "========================================================================="
155+
echo -e "Checking New passed cases in Known issue list for ${ut_suite} with skip"
156+
echo -e "========================================================================="
157+
check_passed_known_issues "${ut_suite}"_with_skip_test_passed.log Known_issue.log
126158
if [[ -f "${ut_suite}_with_skip_test_failed_filtered.log" ]]; then
127159
num_failed_with_skip=$(wc -l < "./${ut_suite}_with_skip_test_failed_filtered.log")
128160
else
@@ -136,6 +168,10 @@ if [[ "${ut_suite}" == 'op_ut' ]]; then
136168
echo -e "Checking Failed cases in ${ut_suite} with only"
137169
echo -e "========================================================================="
138170
compare_and_filter_logs "${ut_suite}"_with_only_test_failed.log Known_issue.log
171+
echo -e "========================================================================="
172+
echo -e "Checking New passed cases in Known issue list for ${ut_suite} with only"
173+
echo -e "========================================================================="
174+
check_passed_known_issues "${ut_suite}"_with_only_test_passed.log Known_issue.log
139175
if [[ -f "${ut_suite}_with_only_test_failed_filtered.log" ]]; then
140176
num_failed_with_only=$(wc -l < "./${ut_suite}_with_only_test_failed_filtered.log")
141177
else
@@ -186,6 +222,7 @@ fi
186222
if [[ "${ut_suite}" == 'xpu_distributed' ]]; then
187223
grep -E "^FAILED" xpu_distributed_test.log | awk '{print $2}' > ./"${ut_suite}"_xpu_distributed_test_failed.log
188224
grep -E "have failures" xpu_distributed_test.log | awk '{print $1}' >> ./"${ut_suite}"_xpu_distributed_test_failed.log
225+
grep "PASSED" xpu_distributed_test.log | awk '{print $1}' > ./"${ut_suite}"_xpu_distributed_test_passed.log
189226
echo -e "========================================================================="
190227
echo -e "Show Failed cases in ${ut_suite} xpu distributed"
191228
echo -e "========================================================================="
@@ -194,6 +231,10 @@ if [[ "${ut_suite}" == 'xpu_distributed' ]]; then
194231
echo -e "Checking Failed cases in ${ut_suite} xpu distributed"
195232
echo -e "========================================================================="
196233
compare_and_filter_logs "${ut_suite}"_xpu_distributed_test_failed.log Known_issue.log
234+
echo -e "========================================================================="
235+
echo -e "Checking New passed cases in Known issue list for ${ut_suite}"
236+
echo -e "========================================================================="
237+
check_passed_known_issues "${ut_suite}"_xpu_distributed_test_passed.log Known_issue.log
197238
if [[ -f "${ut_suite}_xpu_distributed_test_failed_filtered.log" ]]; then
198239
num_failed_xpu_distributed=$(wc -l < "./${ut_suite}_xpu_distributed_test_failed_filtered.log")
199240
else

0 commit comments

Comments
 (0)