Skip to content

Commit 7d1e685

Browse files
[SYCL] CI changes for In-Tree End-to-End tests
I'm extending our test matrix with `in_tree_e2e` parameter and updating llvm_test_suite action/sycl_linux_build_and_test workflow to respect its value.
1 parent 8c32128 commit 7d1e685

File tree

3 files changed

+62
-4
lines changed

3 files changed

+62
-4
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ jobs:
160160
run: tar -cJf llvm_sycl.tar.xz -C $GITHUB_WORKSPACE/build/install .
161161
- name: Pack LIT
162162
run: tar -cJf lit.tar.xz -C $GITHUB_WORKSPACE/src/llvm/utils/lit .
163+
- name: Pack End-to-End LIT tests
164+
run: tar -cJf e2e_tests.tar.xz -C $GITHUB_WORKSPACE/src/sycl/test-e2e .
163165
- name: Upload toolchain
164166
uses: actions/upload-artifact@v3
165167
with:
@@ -170,6 +172,11 @@ jobs:
170172
with:
171173
name: sycl_lit_${{ inputs.build_artifact_suffix }}
172174
path: lit.tar.xz
175+
- name: Upload End-to-End LIT tests
176+
uses: actions/upload-artifact@v3
177+
with:
178+
name: sycl_e2e_tests_${{ inputs.build_artifact_suffix }}
179+
path: e2e_tests.tar.xz
173180

174181
aws-start:
175182
name: Start AWS
@@ -241,9 +248,12 @@ jobs:
241248
sycl_archive: llvm_sycl.tar.xz
242249
lit_artifact: sycl_lit_${{ inputs.build_artifact_suffix }}
243250
lit_archive: lit.tar.xz
251+
e2e_tests_artifact: sycl_e2e_tests_${{ inputs.build_artifact_suffix }}
252+
e2e_tests_archive: e2e_tests.tar.xz
244253
check_sycl_all: ${{ matrix.check_sycl_all }}
245254
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
246255
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
256+
in_tree_e2e: ${{ matrix.in_tree_e2e }}
247257

248258
khronos_sycl_cts:
249259
needs: build

devops/actions/llvm_test_suite/action.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ inputs:
1919
description: 'Name of LIT archive file'
2020
required: false
2121
default: 'lit.tar.xz'
22+
e2e_tests_artifact:
23+
description: 'Name of the artifact, that contains End-to-End LIT Tests'
24+
required: true
25+
e2e_tests_archive:
26+
description: 'Name of End-to-End LIT Tests archive file'
27+
required: false
28+
default: 'e2e_tests.tar.xz'
2229
results_name_suffix:
2330
description: 'Name suffix of the results artifact'
2431
required: true
@@ -28,6 +35,10 @@ inputs:
2835
cmake_args:
2936
description: 'Extra arguments to cmake command'
3037
required: false
38+
in_tree_e2e:
39+
description: "Flag directing to use in-tree End-to-End LIT tests"
40+
required: false
41+
default: false
3142

3243
post-if: false
3344
runs:
@@ -66,13 +77,33 @@ runs:
6677
ls -la
6778
tar -xf ${{ inputs.lit_archive }} -C lit
6879
rm -f ${{ inputs.lit_archive }}
80+
- name: Download End-to-End LIT Tests
81+
if: inputs.in_tree_e2e
82+
uses: actions/download-artifact@v3
83+
with:
84+
name: ${{ inputs.e2e_tests_artifact }}
85+
- name: Extract End-to-End LIT Tests
86+
if: inputs.in_tree_e2e
87+
shell: bash
88+
run: |
89+
mkdir test_e2e
90+
ls -la
91+
tar -xf ${{ inputs.e2e_tests_archive }} -C test_e2e
92+
ls -R test_e2e
93+
rm -f ${{ inputs.e2e_tests_archive }}
6994
- name: Configure
7095
shell: bash
7196
run: |
7297
echo "::group::CMake configuration"
7398
mkdir build
7499
export PATH=$PWD/toolchain/bin/:$PATH
75-
cmake -GNinja -B./build -S./llvm_test_suite -DTEST_SUITE_SUBDIRS=SYCL -DCHECK_SYCL_ALL="${{ inputs.check_sycl_all }}" -DCMAKE_CXX_COMPILER="$PWD/toolchain/bin/clang++" -DTEST_SUITE_LIT="$PWD/lit/lit.py" ${{ inputs.cmake_args }}
100+
if ${{ inputs.in_tree_e2e }}
101+
then
102+
# TODO: Rename check_sycl_all input
103+
cmake -GNinja -B./build -S./test_e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.check_sycl_all }}" -DCMAKE_CXX_COMPILER="$PWD/toolchain/bin/clang++" -DLLVM_LIT="$PWD/lit/lit.py" ${{ inputs.cmake_args }}
104+
else
105+
cmake -GNinja -B./build -S./llvm_test_suite -DTEST_SUITE_SUBDIRS=SYCL -DCHECK_SYCL_ALL="${{ inputs.check_sycl_all }}" -DCMAKE_CXX_COMPILER="$PWD/toolchain/bin/clang++" -DTEST_SUITE_LIT="$PWD/lit/lit.py" ${{ inputs.cmake_args }}
106+
fi
76107
echo "::endgroup::"
77108
- name: Run testing
78109
shell: bash
@@ -81,7 +112,10 @@ runs:
81112
export PATH=$PWD/toolchain/bin/:$PATH
82113
# TODO make this part of container build
83114
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/hip/lib/:/opt/rocm/lib
84-
export LIT_OPTS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests -o $PWD/build/results_${{ inputs.results_name_suffix }}.json"
115+
# For standalone llvm-test-suite
116+
export LIT_OPTS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests -o $PWD/build/results_${{ inputs.results_name_suffix }}_${{ inputs.in_tree_e2e }}.json"
117+
# For in-tree End-to-End tests
118+
export SYCL_TEST_E2E_TARGETS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests -o $PWD/build/results_${{ inputs.results_name_suffix }}_${{ inputs.in_tree_e2e }}.json"
85119
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
86120
source /runtimes/oneapi-tbb/env/vars.sh;
87121
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
@@ -103,13 +137,18 @@ runs:
103137
SYCL_PI_TRACE=-1 sycl-ls
104138
echo "::endgroup::"
105139
cd build
106-
ninja check-sycl-all
140+
if ${{ inputs.in_tree_e2e }}
141+
then
142+
ninja check-sycl-e2e
143+
else
144+
ninja check-sycl-all
145+
fi
107146
- name: Upload test results
108147
uses: actions/upload-artifact@v1
109148
if: always()
110149
with:
111150
name: lit_results
112-
path: build/results_${{ inputs.results_name_suffix }}.json
151+
path: build/results_${{ inputs.results_name_suffix }}_${{ inputs.in_tree_e2e}}.json
113152
- name: Cleanup
114153
shell: bash
115154
if: always()
@@ -118,3 +157,4 @@ runs:
118157
rm -rf lit
119158
rm -rf build
120159
rm -rf llvm_test_suite
160+
rm -rf test-e2e

devops/scripts/generate_test_matrix.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ module.exports = ({core, process}) => {
4747
} else {
4848
v["env"] = {};
4949
}
50+
// Temporary support for both in-tree/out-of-tree (llvm-test-suite)
51+
// end-to-end tests.
52+
v["in_tree_e2e"] = false;
5053
enabledLTSConfigs.push(v);
5154
if (v["aws-type"]) enabledLTSAWSConfigs.push(v);
55+
56+
var inTreeV = Object.assign({}, v);
57+
inTreeV["in_tree_e2e"] = true;
58+
inTreeV["name"] = inTreeV["name"] + " In-Tree"
59+
enabledLTSConfigs.push(inTreeV);
5260
}
5361
});
5462

0 commit comments

Comments
 (0)