Skip to content

Commit 7148778

Browse files
authored
[CI][CTS] Check if the cts_exclude_filter exists (#17715)
Otherwise `cat` may return 1 and fail the step.
1 parent 4a7ef04 commit 7148778

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

devops/actions/run-tests/cts/action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ runs:
6767
# SYCL_CTS_EXCLUDE_TEST_CATEGORIES - Optional file specifying a list
6868
# of test categories to be excluded from the build.
6969
echo "::group::Excluded test categories"
70-
cat $cts_exclude_filter
70+
[ -f "$cts_exclude_filter" ] && cat "$cts_exclude_filter"
7171
echo "::endgroup::"
7272
fi
7373
@@ -134,11 +134,13 @@ runs:
134134
cts_exclude_filter=$PWD/sycl/cts_exclude_filter/L0_GPU
135135
fi
136136
137-
while IFS= read -r line; do
138-
if [[ $line != \#* ]]; then
139-
rm "./build-cts/bin/test_$line"
140-
fi
141-
done < "$cts_exclude_filter"
137+
if [ -f "$cts_exclude_filter" ]; then
138+
while IFS= read -r line; do
139+
if [[ $line != \#* ]]; then
140+
rm "./build-cts/bin/test_$line"
141+
fi
142+
done < "$cts_exclude_filter"
143+
fi
142144
143145
- name: Run SYCL CTS tests
144146
# Proceed with execution even if the previous two steps did not succeed.

devops/actions/run-tests/windows/cts/action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ runs:
6767
# SYCL_CTS_EXCLUDE_TEST_CATEGORIES - Optional file specifying a list
6868
# of test categories to be excluded from the build.
6969
echo "::group::Excluded test categories"
70-
cat $cts_exclude_filter
70+
[ -f "$cts_exclude_filter" ] && cat "$cts_exclude_filter"
7171
echo "::endgroup::"
7272
fi
7373
@@ -136,11 +136,13 @@ runs:
136136
cts_exclude_filter=$PWD/sycl/cts_exclude_filter/L0_GPU
137137
fi
138138
139-
while IFS= read -r line; do
140-
if [[ $line != \#* ]]; then
141-
rm "./build-cts/bin/test_$line"
142-
fi
143-
done < "$cts_exclude_filter"
139+
if [ -f "$cts_exclude_filter" ]; then
140+
while IFS= read -r line; do
141+
if [[ $line != \#* ]]; then
142+
rm "./build-cts/bin/test_$line"
143+
fi
144+
done < "$cts_exclude_filter"
145+
fi
144146
145147
- name: Run SYCL CTS tests
146148
# Proceed with execution even if the previous two steps did not succeed.

0 commit comments

Comments
 (0)