5 DEQP_OPTIONS
="$DEQP_OPTIONS --deqp-surface-width=256 --deqp-surface-height=256"
6 DEQP_OPTIONS
="$DEQP_OPTIONS --deqp-surface-type=pbuffer"
7 DEQP_OPTIONS
="$DEQP_OPTIONS --deqp-gl-config-name=rgba8888d24s8ms0"
8 DEQP_OPTIONS
="$DEQP_OPTIONS --deqp-visibility=hidden"
10 # deqp's shader cache (for vulkan) is not multiprocess safe for a common
12 # https://gitlab.freedesktop.org/mesa/parallel-deqp-runner/-/merge_requests/13
13 DEQP_OPTIONS
="$DEQP_OPTIONS --deqp-shadercache=disable"
15 if [ -z "$DEQP_VER" ]; then
16 echo 'DEQP_VER must be set to something like "gles2", "gles31" or "vk" for the test run'
20 if [ "$DEQP_VER" = "vk" ]; then
21 if [ -z "$VK_DRIVER" ]; then
22 echo 'VK_DRIVER must be to something like "radeon" or "intel" for the test run'
27 if [ -z "$DEQP_SKIPS" ]; then
28 echo 'DEQP_SKIPS must be set to something like "deqp-default-skips.txt"'
34 # Set up the driver environment.
35 export LD_LIBRARY_PATH
=`pwd`/install
/lib
/
36 export EGL_PLATFORM
=surfaceless
37 export VK_ICD_FILENAMES
=`pwd`/install
/share
/vulkan
/icd.d
/"$VK_DRIVER"_icd.
`uname -m`.json
39 # the runner was failing to look for libkms in /usr/local/lib for some reason
40 # I never figured out.
41 export LD_LIBRARY_PATH
=$LD_LIBRARY_PATH:/usr
/local
/lib
46 # Generate test case list file.
47 if [ "$DEQP_VER" = "vk" ]; then
48 cp /deqp
/mustpass
/vk-master.txt
/tmp
/case-list.txt
49 DEQP
=/deqp
/external
/vulkancts
/modules
/vulkan
/deqp-vk
50 elif [ "$DEQP_VER" = "gles2" -o "$DEQP_VER" = "gles3" -o "$DEQP_VER" = "gles31" ]; then
51 cp /deqp
/mustpass
/$DEQP_VER-master.txt
/tmp
/case-list.txt
52 DEQP
=/deqp
/modules
/$DEQP_VER/deqp-
$DEQP_VER
55 cp /deqp
/mustpass
/$DEQP_VER-master.txt
/tmp
/case-list.txt
56 DEQP
=/deqp
/external
/openglcts
/modules
/glcts
60 # If the job is parallel, take the corresponding fraction of the caselist.
61 # Note: N~M is a gnu sed extension to match every nth line (first line is #1).
62 if [ -n "$CI_NODE_INDEX" ]; then
63 sed -ni $CI_NODE_INDEX~
$CI_NODE_TOTAL"p" /tmp
/case-list.txt
66 if [ -n "$DEQP_CASELIST_FILTER" ]; then
67 sed -ni "/$DEQP_CASELIST_FILTER/p" /tmp
/case-list.txt
70 if [ ! -s /tmp
/case-list.txt
]; then
71 echo "Caselist generation failed"
75 if [ -n "$DEQP_EXPECTED_FAILS" ]; then
76 XFAIL
="--xfail-list $INSTALL/$DEQP_EXPECTED_FAILS"
81 if [ -n "$DEQP_PARALLEL" ]; then
82 JOB
="--job $DEQP_PARALLEL"
92 --caselist $caselist \
93 --exclude-list $INSTALL/$DEQP_SKIPS \
94 --compact-display false \
98 $DEQP_RUNNER_OPTIONS \
104 if [ -z "$FLAKES_CHANNEL" ]; then
108 # The nick needs to be something unique so that multiple runners
109 # connecting at the same time don't race for one nick and get blocked.
110 # freenode has a 16-char limit on nicks (9 is the IETF standard, but
111 # various servers extend that). So, trim off the common prefixes of the
112 # runner name, and append the job ID so that software runners with more
113 # than one concurrent job (think swrast) don't collide. For freedreno,
114 # that gives us a nick as long as db410c-N-JJJJJJJJ, and it'll be a while
115 # before we make it to 9-digit jobs (we're at 7 so far).
116 runner
=`echo $CI_RUNNER_DESCRIPTION | sed 's|mesa-||' | sed 's|google-freedreno-||g'`
117 bot
="$runner-$CI_JOB_ID"
118 channel
="$FLAKES_CHANNEL"
121 echo USER
$bot unused unused
:Gitlab CI Notifier
125 desc
="Flakes detected in job: $CI_JOB_URL on $CI_RUNNER_DESCRIPTION"
126 if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
127 desc
="$desc on branch $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ($CI_MERGE_REQUEST_TITLE)"
128 elif [ -n "$CI_COMMIT_BRANCH" ]; then
129 desc
="$desc on branch $CI_COMMIT_BRANCH ($CI_COMMIT_TITLE)"
131 echo "PRIVMSG $channel :$desc"
132 for flake
in `cat $flakes`; do
133 echo "PRIVMSG $channel :$flake"
135 echo "PRIVMSG $channel :See $CI_JOB_URL/artifacts/browse/results/"
137 ) | nc irc.freenode.net
6667 > /dev
/null
141 extract_xml_result
() {
145 start
="#beginTestCaseResult $testcase"
147 # Pick the first QPA mentioning our testcase
148 qpa
=`grep -l "$start" $qpas | head -n 1`
150 # If we found one, go extract just that testcase's contents from the QPA
151 # to a new QPA, then do testlog-to-xml on that.
152 if [ -n "$qpa" ]; then
153 while IFS
= read -r line
; do
154 if [ "$line" = "$start" ]; then
156 echo "#beginSession" > $dst
158 while IFS
= read -r line
; do
159 if [ "$line" = "#endTestCaseResult" ]; then
161 echo "#endSession" >> $dst
162 /deqp
/executor
/testlog-to-xml
$dst "$RESULTS/$testcase$DEQP_RUN_SUFFIX.xml"
163 # copy the stylesheets here so they only end up in artifacts
164 # if we have one or more result xml in artifacts
165 cp /deqp
/testlog.css
"$RESULTS/"
166 cp /deqp
/testlog.xsl
"$RESULTS/"
177 extract_xml_results
() {
179 while IFS
= read -r testcase
; do
180 testcase
=${testcase%,*}
181 extract_xml_result
$testcase $qpas
185 # Generate junit results
188 echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
190 echo "<testsuite name=\"$DEQP_VER-$CI_NODE_INDEX\">"
194 # avoid counting Skip's in the # of tests:
195 if [ "$result" = "Skip" ]; then
198 echo "<testcase name=\"$testcase\">"
199 if [ "$result" != "Pass" ]; then
200 echo "<failure type=\"$result\">"
201 echo "$result: See $CI_JOB_URL/artifacts/results/$testcase.xml"
211 RENDERER
=`grep -A1 TestCaseResult.\*info.renderer $RESULTS/deqp-info.qpa | grep '<Text' | sed 's|.*<Text>||g' | sed 's|</Text>||g'`
212 VERSION
=`grep -A1 TestCaseResult.\*info.version $RESULTS/deqp-info.qpa | grep '<Text' | sed 's|.*<Text>||g' | sed 's|</Text>||g'`
213 echo "Renderer: $RENDERER"
214 echo "Version: $VERSION "
216 if ! echo $RENDERER |
grep -q $DEQP_EXPECTED_RENDERER; then
217 echo "Expected GL_RENDERER $DEQP_EXPECTED_RENDERER"
223 echo "Capturing renderer info for GLES driver sanity checks"
224 # If you're having trouble loading your driver, uncommenting this may help
226 # export EGL_LOG_LEVEL=debug
227 VERSION
=`echo $DEQP_VER | tr '[a-z]' '[A-Z]'`
228 $DEQP $DEQP_OPTIONS --deqp-case=$SUITE-$VERSION.info.\
* --deqp-log-filename=$RESULTS/deqp-info.qpa
232 check_vk_device_name
() {
233 echo "Capturing device info for VK driver sanity checks"
234 $DEQP $DEQP_OPTIONS --deqp-case=dEQP-VK.info.device
--deqp-log-filename=$RESULTS/deqp-info.qpa
235 DEVICENAME
=`grep deviceName $RESULTS/deqp-info.qpa | sed 's|deviceName: ||g'`
236 echo "deviceName: $DEVICENAME"
237 if [ -n "$DEQP_EXPECTED_RENDERER" -a $DEVICENAME != "$DEQP_EXPECTED_RENDERER" ]; then
238 echo "Expected deviceName $DEQP_EXPECTED_RENDERER"
243 # wrapper to supress +x to avoid spamming the log
250 if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
251 # deqp is to use virpipe, and virgl_test_server llvmpipe
252 export GALLIUM_DRIVER
="$GALLIUM_DRIVER"
254 VTEST_ARGS
="--use-egl-surfaceless"
255 if [ "$VIRGL_HOST_API" = "GLES" ]; then
256 VTEST_ARGS
="$VTEST_ARGS --use-gles"
259 GALLIUM_DRIVER
=llvmpipe \
260 GALLIVM_PERF
="nopt,no_filter_hacks" \
261 virgl_test_server
$VTEST_ARGS >$RESULTS/vtest-log.txt
2>&1 &
266 if [ $DEQP_VER = vk
]; then
267 quiet check_vk_device_name
272 RESULTSFILE
=$RESULTS/cts-runner-results
$DEQP_RUN_SUFFIX.txt
273 UNEXPECTED_RESULTSFILE
=$RESULTS/cts-runner-unexpected-results
$DEQP_RUN_SUFFIX.txt
274 FLAKESFILE
=$RESULTS/cts-runner-flakes
$DEQP_RUN_SUFFIX.txt
276 run_cts
$DEQP /tmp
/case-list.txt
$RESULTSFILE
279 # junit is disabled, because it overloads gitlab.freedesktop.org to parse it.
280 #quiet generate_junit $RESULTSFILE > $RESULTS/results.xml
282 if [ $DEQP_EXITCODE -ne 0 ]; then
283 # preserve caselist files in case of failures:
284 cp /tmp
/deqp_runner.
*.txt
$RESULTS/
285 egrep -v ",Pass|,Skip|,ExpectedFail" $RESULTSFILE > $UNEXPECTED_RESULTSFILE
287 if [ -z "$DEQP_NO_SAVE_RESULTS" ]; then
288 echo "Some unexpected results found (see cts-runner-results.txt in artifacts for full results):"
289 head -n 50 $UNEXPECTED_RESULTSFILE
291 # Save the logs for up to the first 50 unexpected results:
292 head -n 50 $UNEXPECTED_RESULTSFILE | quiet extract_xml_results
/tmp
/*.qpa
294 echo "Unexpected results found:"
295 cat $UNEXPECTED_RESULTSFILE
298 count
=`cat $UNEXPECTED_RESULTSFILE | wc -l`
300 # Re-run fails to detect flakes. But use a small threshold, if
301 # something was fundamentally broken, we don't want to re-run
302 # the entire caselist
304 grep ",Flake" $RESULTSFILE > $FLAKESFILE
306 count
=`cat $FLAKESFILE | wc -l`
307 if [ $count -gt 0 ]; then
308 echo "Some flakes found (see cts-runner-flakes.txt in artifacts for full results):"
309 head -n 50 $FLAKESFILE
311 if [ -z "$DEQP_NO_SAVE_RESULTS" ]; then
312 # Save the logs for up to the first 50 flakes:
313 head -n 50 $FLAKESFILE | quiet extract_xml_results
/tmp
/*.qpa
316 # Report the flakes to IRC channel for monitoring (if configured):
317 quiet report_flakes
$FLAKESFILE
319 # no flakes, so clean-up: