Skip to content

Commit 0dc9f30

Browse files
committed
Ensure that expected fails on CTS always show as a pass.
When we have regular fails which we do not expect an immediate fix, we want to show as pass so we can catch be failures more easily. When we know there is an expected fail, we create files to cover fails on all targets or fails on a particular target for OpenCL CTS and SYCL CTS. These will be under .github/opencl_cts and .github/sycl_cts. Fails files will be of the form expect_fail_all.csv or expect_fail_<target>.csv. These should match lines in the original csv file being used.
1 parent 4e8b3a3 commit 0dc9f30

File tree

5 files changed

+57
-4
lines changed

5 files changed

+57
-4
lines changed

.github/actions/run_opencl_cts/action.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ runs:
2727
CTS_FILTER: cts-3.0-online-ignore-linux-host.csv
2828
CTS_TIMEOUT: 18:00:00 # OK for github?
2929
run: |
30-
cd "$GITHUB_WORKSPACE/OpenCL-CTS"
3130
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
3231
export QEMU_SETTING=""
3332
if [[ "${{inputs.target}}" =~ .*aarch64.* ]] ; then
@@ -37,6 +36,11 @@ runs:
3736
fi
3837
echo QEMU SETTING: $QEMU SETTING
3938
set -x
39+
echo > expect_fail.csv
40+
# $CTS_FILTER ignores certain test, so is treated differently to temporary fails.
41+
[ -f .github/opencl_cts/expect_fail_all.csv ] && cat .github/opencl_cts/expect_fail_all.csv >> expect_fail.csv
42+
[ -f .github/opencl_cts/expect_fail_${{ inputs.target }}.csv ] && cat .github/opencl_cts/expect_fail_${{ inputs.target }}.csv >> expect_fail.csv
43+
cat expect_fail.csv "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" > disable.csv
4044
# Note: use 'eval' built-in to handle quoting/escaping/splitting reqs
4145
RUN_CITIES="python3 -u $GITHUB_WORKSPACE/scripts/testing/run_cities.py -v \
4246
--color=always --timeout $CTS_TIMEOUT \
@@ -47,5 +51,23 @@ runs:
4751
-e OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so \
4852
-e CL_PLATFORM_INDEX=0 \
4953
-s $GITHUB_WORKSPACE/test_conformance/$CTS_CSV_FILE \
50-
-i $GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER"
54+
-i disable.csv"
5155
eval $RUN_CITIES
56+
57+
- name: Run expected failed opencl cts
58+
shell: bash
59+
env:
60+
CTS_TIMEOUT: 18:00:00
61+
run: |
62+
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
63+
set -x
64+
RUN_CITIES="python3 -u $GITHUB_WORKSPACE/scripts/testing/run_cities.py -v \
65+
--color=always --timeout $CTS_TIMEOUT \
66+
$QEMU_SETTING \
67+
-b $GITHUB_WORKSPACE/test_conformance \
68+
-L $GITHUB_WORKSPACE/install_icd/lib \
69+
-e CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc \
70+
-e OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so \
71+
-e CL_PLATFORM_INDEX=0 \
72+
-s expect_fail.csv"
73+
eval $RUN_CITIES || echo failed as expected

.github/actions/run_sycl_cts/action.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,17 @@ runs:
6262
SYCL_CTS_TIMEOUT: '02:00:00'
6363
SYCL_CTS_FILTER: ''
6464
run: |
65+
set -x
6566
echo running sycl cts
6667
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install_dpcpp/lib:$GITHUB_WORKSPACE/install_ock/lib
6768
export ONEAPI_DEVICE_SELECTOR=opencl:0
6869
export CTS_CSV_FILE=$GITHUB_WORKSPACE/.github/scripts/sycl-cts.csv
69-
set -x
70+
echo > expect_fail.csv
71+
# $CTS_FILTER ignores certain test, so is treated differently to temporary fails.
72+
[ -f .github/sycl_cts/expect_fail_all.csv ] && cat .github/sycl_cts/expect_fail_all.csv >> expect_fail.csv
73+
[ -f .github/sycl_cts/expect_fail_${{ inputs.target }}.csv ] && cat .github/sycl_cts/expect_fail_${{ inputs.target }}.csv >> expect_fail.csv
74+
cp expect_fail.csv disable.csv
75+
[ -f "$SYCL_CTS_FILTER" ] && cat "$SYCL_CTS_FILTER" >> disable.csv
7076
python3 $GITHUB_WORKSPACE/scripts/testing/run_cities.py \
7177
--color=always \
7278
--timeout $SYCL_CTS_TIMEOUT \
@@ -79,9 +85,30 @@ runs:
7985
-l SYCL-CTS/cts.log -f SYCL-CTS/cts.fail \
8086
-r SYCL-CTS/cts.xml \
8187
-v \
82-
$SYCL_CTS_FILTER || exitcode=$?
88+
-i disable.csv || exitcode=$?
8389
export OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so
8490
$GITHUB_WORKSPACE/.github/scripts/create_sycl_cts_test_lists.sh $PREPEND_PATH SYCL-CTS $CTS_CSV_FILE csv.txt cts_all.txt
8591
# output a diff of the generated list csv.txt and cts_all.txt
8692
diff csv.txt cts_all.txt || echo "WARNING - Missing some tests from sycl cts file based on test_all --list-tests - see > above"
8793
exit $exitcode
94+
95+
- name: run sycl cts expected fails
96+
shell: bash
97+
env:
98+
PREPEND_PATH: '' # TODO: have qemu as input and set up this
99+
SYCL_CTS_TIMEOUT: '02:00:00'
100+
run: |
101+
echo running sycl cts
102+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install_dpcpp/lib:$GITHUB_WORKSPACE/install_ock/lib
103+
export ONEAPI_DEVICE_SELECTOR=opencl:0
104+
python3 $GITHUB_WORKSPACE/scripts/testing/run_cities.py \
105+
--color=always \
106+
--timeout $SYCL_CTS_TIMEOUT \
107+
$PREPEND_PATH \
108+
-p sycl_cts \
109+
-b SYCL-CTS/bin \
110+
-L SYCL-CTS/lib \
111+
-e OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so \
112+
-l SYCL-CTS/cts.log -f SYCL-CTS/cts.fail \
113+
-r SYCL-CTS/cts.xml \
114+
-s expect_fail.csv || echo failed as expected
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
API,api/test_api
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Math,math_brute_force/test_bruteforce -w

.github/sycl_cts/expect_fail_all.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SYCL_CTS,test_math_builtin_api "math_builtin_float_base_*"
2+
SYCL_CTS,test_math_builtin_api "math_builtin_float_double_*"

0 commit comments

Comments
 (0)