Skip to content

Commit e8e552d

Browse files
committed
fix xml files collection issue
1 parent 97f956a commit e8e552d

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

.github/actions/linux-uttest/action.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,7 @@ runs:
7474
python run_test_with_skip.py \
7575
2> ${{ github.workspace }}/ut_log/op_ut/op_ut_with_skip_test_error.log | \
7676
tee ${{ github.workspace }}/ut_log/op_ut/op_ut_with_skip_test.log
77-
ls -al
78-
cp *.xml ${{ github.workspace }}/ut_log
79-
find op_ut_with_skip.nn op_ut_with_skip.quantization/core op_ut_with_all.functorch -type f -exec sh -c '
80-
dir_path=$(dirname "$1");
81-
case "$dir_path" in
82-
*"op_ut_with_skip.quantization/core"*)
83-
dir_name="op_ut_with_skip.quantization.core";;
84-
*"op_ut_with_all.functorch"*)
85-
dir_name="op_ut_with_all.functorch";;
86-
*)
87-
dir_name="op_ut_with_skip.nn";;
88-
esac;
89-
mv "$1" "$dir_path/${dir_name}.$(basename "$1")"
90-
' _ {} \;
91-
ls -al op_ut_with_skip.nn op_ut_with_skip.quantization/core op_ut_with_all.functorch
92-
cp op_ut_with_skip.nn/*.xml ${{ github.workspace }}/ut_log
93-
cp op_ut_with_skip.quantization/core/*.xml ${{ github.workspace }}/ut_log
94-
cp op_ut_with_all.functorch/*.xml ${{ github.workspace }}/ut_log
95-
# Cases run with a on-demand white list, since some suites are too
96-
# slow to go through all operators on CPU. So add cases on-demand
97-
# when XPU implementatoin is done.
98-
# test_foreach, test_decomp
99-
# Run with only
100-
python run_test_with_only.py \
101-
2> ${{ github.workspace }}/ut_log/op_ut/op_ut_with_only_test_error.log | \
102-
tee ${{ github.workspace }}/ut_log/op_ut/op_ut_with_only_test.log
103-
ls -al
104-
cp *.xml ${{ github.workspace }}/ut_log
77+
find . -type f -name "op_ut_with_*.xml" -exec mv {} ${{ github.workspace }}/ut_log/ \;
10578
echo -e "File Path: cd pytorch/third_party/torch-xpu-ops/test/xpu" | tee -a ${{ github.workspace }}/ut_log/reproduce_op_ut.log
10679
echo -e "Reproduce Command: pytest -sv failed_case" | tee -a ${{ github.workspace }}/ut_log/reproduce_op_ut.log
10780
- name: skipped_ut

test/xpu/xpu_test_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,14 +1092,15 @@ def copy_tests(
10921092

10931093
def launch_test(test_case, skip_list=None, exe_list=None):
10941094
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
1095+
module_name = test_case.replace('.py', '').replace('/', '.').replace('\\', '.')
10951096
if skip_list is not None:
10961097
skip_options = ' -k "not ' + skip_list[0]
10971098
for skip_case in skip_list[1:]:
10981099
skip_option = " and not " + skip_case
10991100
skip_options += skip_option
11001101
skip_options += '"'
11011102
test_command = (
1102-
f"pytest --junit-xml=./op_ut_with_skip.{test_case}.xml --max-worker-restart=1000 "
1103+
f"pytest --junit-xml=./op_ut_with_skip.{module_name}.xml"
11031104
+ test_case
11041105
)
11051106
test_command += skip_options
@@ -1110,13 +1111,13 @@ def launch_test(test_case, skip_list=None, exe_list=None):
11101111
exe_options += exe_option
11111112
exe_options += '"'
11121113
test_command = (
1113-
f"pytest --junit-xml=./op_ut_with_exe.{test_case}.xml --max-worker-restart=1000 "
1114+
f"pytest --junit-xml=./op_ut_with_exe.{module_name}.xml"
11141115
+ test_case
11151116
)
11161117
test_command += exe_options
11171118
else:
11181119
test_command = (
1119-
f"pytest --junit-xml=./op_ut_with_all.{test_case}.xml --max-worker-restart=1000 "
1120+
f"pytest --junit-xml=./op_ut_with_all.{module_name}.xml"
11201121
+ test_case
11211122
)
11221123
return os.system(test_command)

0 commit comments

Comments
 (0)