blob: 0010550d293b9c273586837502b78aca1eb26422 [file] [log] [blame]
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +01001#!/bin/sh
Eric Anholt46daaca2019-06-28 16:35:32 -07002
3set -ex
4
Rob Clarkaee1c082020-08-31 09:04:24 -07005DEQP_WIDTH=${DEQP_WIDTH:-256}
6DEQP_HEIGHT=${DEQP_HEIGHT:-256}
7DEQP_CONFIG=${DEQP_CONFIG:-rgba8888d24s8ms0}
8DEQP_VARIANT=${DEQP_VARIANT:-master}
9
10DEQP_OPTIONS="$DEQP_OPTIONS --deqp-surface-width=$DEQP_WIDTH --deqp-surface-height=$DEQP_HEIGHT"
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +010011DEQP_OPTIONS="$DEQP_OPTIONS --deqp-surface-type=pbuffer"
Rob Clarkaee1c082020-08-31 09:04:24 -070012DEQP_OPTIONS="$DEQP_OPTIONS --deqp-gl-config-name=$DEQP_CONFIG"
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +010013DEQP_OPTIONS="$DEQP_OPTIONS --deqp-visibility=hidden"
Eric Anholt46daaca2019-06-28 16:35:32 -070014
Eric Anholt46daaca2019-06-28 16:35:32 -070015if [ -z "$DEQP_VER" ]; then
Samuel Pitoiset16b999b2019-11-19 08:39:00 +010016 echo 'DEQP_VER must be set to something like "gles2", "gles31" or "vk" for the test run'
Eric Anholt46daaca2019-06-28 16:35:32 -070017 exit 1
18fi
19
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +010020if [ "$DEQP_VER" = "vk" ]; then
Samuel Pitoisetf32bf4f2019-11-14 12:09:44 +010021 if [ -z "$VK_DRIVER" ]; then
22 echo 'VK_DRIVER must be to something like "radeon" or "intel" for the test run'
23 exit 1
24 fi
25fi
26
Eric Anholt46daaca2019-06-28 16:35:32 -070027if [ -z "$DEQP_SKIPS" ]; then
28 echo 'DEQP_SKIPS must be set to something like "deqp-default-skips.txt"'
29 exit 1
30fi
31
Tomeu Vizoso92f3c512020-03-24 12:58:30 +010032INSTALL=`pwd`/install
Eric Anholt46daaca2019-06-28 16:35:32 -070033
34# Set up the driver environment.
35export LD_LIBRARY_PATH=`pwd`/install/lib/
36export EGL_PLATFORM=surfaceless
Eric Anholt6766d512020-05-26 11:18:33 -070037export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.`uname -m`.json
Eric Anholt46daaca2019-06-28 16:35:32 -070038
39# the runner was failing to look for libkms in /usr/local/lib for some reason
40# I never figured out.
41export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
42
Eric Anholtbf29daa2020-10-29 10:29:28 -070043RESULTS=`pwd`/${DEQP_RESULTS_DIR:-results}
Eric Anholt46daaca2019-06-28 16:35:32 -070044mkdir -p $RESULTS
45
Samuel Pitoiset16b999b2019-11-19 08:39:00 +010046# Generate test case list file.
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +010047if [ "$DEQP_VER" = "vk" ]; then
Rob Clarkaee1c082020-08-31 09:04:24 -070048 cp /deqp/mustpass/vk-$DEQP_VARIANT.txt /tmp/case-list.txt
Samuel Pitoiset16b999b2019-11-19 08:39:00 +010049 DEQP=/deqp/external/vulkancts/modules/vulkan/deqp-vk
Tomeu Vizoso287bf5f2020-05-13 09:46:06 +020050elif [ "$DEQP_VER" = "gles2" -o "$DEQP_VER" = "gles3" -o "$DEQP_VER" = "gles31" ]; then
Rob Clarkaee1c082020-08-31 09:04:24 -070051 cp /deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt /tmp/case-list.txt
Samuel Pitoiset16b999b2019-11-19 08:39:00 +010052 DEQP=/deqp/modules/$DEQP_VER/deqp-$DEQP_VER
Tomeu Vizoso287bf5f2020-05-13 09:46:06 +020053 SUITE=dEQP
54else
Rob Clarkaee1c082020-08-31 09:04:24 -070055 cp /deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt /tmp/case-list.txt
Tomeu Vizoso287bf5f2020-05-13 09:46:06 +020056 DEQP=/deqp/external/openglcts/modules/glcts
57 SUITE=KHR
Samuel Pitoiset16b999b2019-11-19 08:39:00 +010058fi
Eric Anholt46daaca2019-06-28 16:35:32 -070059
Eric Anholt46daaca2019-06-28 16:35:32 -070060# 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).
62if [ -n "$CI_NODE_INDEX" ]; then
63 sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
64fi
65
Eric Anholt5082ac02020-04-17 12:02:37 -070066if [ -n "$DEQP_CASELIST_FILTER" ]; then
Eric Anholt90cf4942020-05-15 17:18:12 -070067 sed -ni "/$DEQP_CASELIST_FILTER/p" /tmp/case-list.txt
Eric Anholt5082ac02020-04-17 12:02:37 -070068fi
69
Eric Anholt46daaca2019-06-28 16:35:32 -070070if [ ! -s /tmp/case-list.txt ]; then
71 echo "Caselist generation failed"
72 exit 1
73fi
74
Eric Anholtf08c8102019-11-04 10:54:41 -080075if [ -n "$DEQP_EXPECTED_FAILS" ]; then
Eric Anholtbf29daa2020-10-29 10:29:28 -070076 BASELINE="--baseline $INSTALL/$DEQP_EXPECTED_FAILS"
77fi
78
79if [ -n "$DEQP_FLAKES" ]; then
80 FLAKES="--flakes $INSTALL/$DEQP_FLAKES"
Eric Anholtf08c8102019-11-04 10:54:41 -080081fi
Eric Anholt46daaca2019-06-28 16:35:32 -070082
Eric Anholtf08c8102019-11-04 10:54:41 -080083set +e
84
Samuel Pitoiset4668a082020-03-05 15:20:34 +010085if [ -n "$DEQP_PARALLEL" ]; then
Eric Anholtbf29daa2020-10-29 10:29:28 -070086 JOB="--jobs $DEQP_PARALLEL"
Eric Anholtfd24a952020-06-26 10:59:41 -070087elif [ -n "$FDO_CI_CONCURRENT" ]; then
Eric Anholtbf29daa2020-10-29 10:29:28 -070088 JOB="--jobs $FDO_CI_CONCURRENT"
Eric Anholtfd24a952020-06-26 10:59:41 -070089else
Eric Anholtbf29daa2020-10-29 10:29:28 -070090 JOB="--jobs 4"
Samuel Pitoiset4668a082020-03-05 15:20:34 +010091fi
92
Eric Anholtbf29daa2020-10-29 10:29:28 -070093# If this CI lab lacks artifacts support, print the whole list of failures/flakes.
94if [ -z "$DEQP_NO_SAVE_RESULTS" ]; then
95 SUMMARY_LIMIT="--summary-limit 0"
96fi
97
98# Silence the debug output for apps triggering GL errors, since dEQP will do a lot of that.
99export MESA_DEBUG=silent
100
Rob Clarkfdaf7772019-11-17 11:33:01 -0800101run_cts() {
Samuel Pitoiset16b999b2019-11-19 08:39:00 +0100102 deqp=$1
103 caselist=$2
104 output=$3
Rob Clarkfdaf7772019-11-17 11:33:01 -0800105 deqp-runner \
Eric Anholtbf29daa2020-10-29 10:29:28 -0700106 run \
Samuel Pitoiset16b999b2019-11-19 08:39:00 +0100107 --deqp $deqp \
Eric Anholtbf29daa2020-10-29 10:29:28 -0700108 --output $RESULTS \
Rob Clarkfdaf7772019-11-17 11:33:01 -0800109 --caselist $caselist \
Eric Anholtbf29daa2020-10-29 10:29:28 -0700110 --skips $INSTALL/$DEQP_SKIPS \
111 $BASELINE \
112 $FLAKES \
Samuel Pitoiset4668a082020-03-05 15:20:34 +0100113 $JOB \
Eric Anholtbf29daa2020-10-29 10:29:28 -0700114 $SUMMARY_LIMIT \
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +0100115 $DEQP_RUNNER_OPTIONS \
Rob Clarkfdaf7772019-11-17 11:33:01 -0800116 -- \
Tomeu Vizosod62dd8b2019-12-13 10:20:23 +0100117 $DEQP_OPTIONS
Rob Clarkfdaf7772019-11-17 11:33:01 -0800118}
119
120report_flakes() {
Eric Anholtbf29daa2020-10-29 10:29:28 -0700121 flakes=`grep ",Flake" $1 | sed 's|,Flake.*||g'`
122 if [ -z "$flakes" ]; then
123 return 0
124 fi
125
Rob Clarkfdaf7772019-11-17 11:33:01 -0800126 if [ -z "$FLAKES_CHANNEL" ]; then
127 return 0
128 fi
Eric Anholtbf29daa2020-10-29 10:29:28 -0700129
Eric Anholt26379612020-05-05 12:17:49 -0700130 # The nick needs to be something unique so that multiple runners
131 # connecting at the same time don't race for one nick and get blocked.
132 # freenode has a 16-char limit on nicks (9 is the IETF standard, but
133 # various servers extend that). So, trim off the common prefixes of the
134 # runner name, and append the job ID so that software runners with more
135 # than one concurrent job (think swrast) don't collide. For freedreno,
136 # that gives us a nick as long as db410c-N-JJJJJJJJ, and it'll be a while
137 # before we make it to 9-digit jobs (we're at 7 so far).
138 runner=`echo $CI_RUNNER_DESCRIPTION | sed 's|mesa-||' | sed 's|google-freedreno-||g'`
139 bot="$runner-$CI_JOB_ID"
Rob Clarkfdaf7772019-11-17 11:33:01 -0800140 channel="$FLAKES_CHANNEL"
141 (
142 echo NICK $bot
143 echo USER $bot unused unused :Gitlab CI Notifier
144 sleep 10
145 echo "JOIN $channel"
146 sleep 1
147 desc="Flakes detected in job: $CI_JOB_URL on $CI_RUNNER_DESCRIPTION"
Eric Anholt2c501762020-05-05 10:44:46 -0700148 if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
Rob Clarkfdaf7772019-11-17 11:33:01 -0800149 desc="$desc on branch $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ($CI_MERGE_REQUEST_TITLE)"
Eric Anholt2c501762020-05-05 10:44:46 -0700150 elif [ -n "$CI_COMMIT_BRANCH" ]; then
151 desc="$desc on branch $CI_COMMIT_BRANCH ($CI_COMMIT_TITLE)"
Rob Clarkfdaf7772019-11-17 11:33:01 -0800152 fi
153 echo "PRIVMSG $channel :$desc"
Eric Anholtbf29daa2020-10-29 10:29:28 -0700154 for flake in $flakes; do
Rob Clarkfdaf7772019-11-17 11:33:01 -0800155 echo "PRIVMSG $channel :$flake"
156 done
157 echo "PRIVMSG $channel :See $CI_JOB_URL/artifacts/browse/results/"
158 echo "QUIT"
159 ) | nc irc.freenode.net 6667 > /dev/null
160
161}
162
Rob Clark9f422cb2019-11-17 12:04:50 -0800163# Generate junit results
164generate_junit() {
165 results=$1
166 echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
167 echo "<testsuites>"
168 echo "<testsuite name=\"$DEQP_VER-$CI_NODE_INDEX\">"
169 while read line; do
170 testcase=${line%,*}
171 result=${line#*,}
172 # avoid counting Skip's in the # of tests:
173 if [ "$result" = "Skip" ]; then
174 continue;
175 fi
176 echo "<testcase name=\"$testcase\">"
177 if [ "$result" != "Pass" ]; then
178 echo "<failure type=\"$result\">"
179 echo "$result: See $CI_JOB_URL/artifacts/results/$testcase.xml"
180 echo "</failure>"
181 fi
182 echo "</testcase>"
183 done < $results
184 echo "</testsuite>"
185 echo "</testsuites>"
186}
187
Eric Anholtff118362020-03-05 14:35:55 -0800188parse_renderer() {
189 RENDERER=`grep -A1 TestCaseResult.\*info.renderer $RESULTS/deqp-info.qpa | grep '<Text' | sed 's|.*<Text>||g' | sed 's|</Text>||g'`
190 VERSION=`grep -A1 TestCaseResult.\*info.version $RESULTS/deqp-info.qpa | grep '<Text' | sed 's|.*<Text>||g' | sed 's|</Text>||g'`
191 echo "Renderer: $RENDERER"
192 echo "Version: $VERSION "
Eric Anholt8b221e02020-04-17 12:39:32 -0700193
194 if ! echo $RENDERER | grep -q $DEQP_EXPECTED_RENDERER; then
195 echo "Expected GL_RENDERER $DEQP_EXPECTED_RENDERER"
196 exit 1
197 fi
Eric Anholtff118362020-03-05 14:35:55 -0800198}
199
200check_renderer() {
Eric Anholt33e08212020-05-26 10:53:05 -0700201 echo "Capturing renderer info for GLES driver sanity checks"
Eric Anholtff118362020-03-05 14:35:55 -0800202 # If you're having trouble loading your driver, uncommenting this may help
203 # debug.
204 # export EGL_LOG_LEVEL=debug
Tomeu Vizosoad3ef6d2020-04-01 09:17:25 +0200205 VERSION=`echo $DEQP_VER | tr '[a-z]' '[A-Z]'`
Tomeu Vizoso287bf5f2020-05-13 09:46:06 +0200206 $DEQP $DEQP_OPTIONS --deqp-case=$SUITE-$VERSION.info.\* --deqp-log-filename=$RESULTS/deqp-info.qpa
Eric Anholtff118362020-03-05 14:35:55 -0800207 parse_renderer
208}
209
Eric Anholt33e08212020-05-26 10:53:05 -0700210check_vk_device_name() {
211 echo "Capturing device info for VK driver sanity checks"
212 $DEQP $DEQP_OPTIONS --deqp-case=dEQP-VK.info.device --deqp-log-filename=$RESULTS/deqp-info.qpa
213 DEVICENAME=`grep deviceName $RESULTS/deqp-info.qpa | sed 's|deviceName: ||g'`
214 echo "deviceName: $DEVICENAME"
Eric Anholt2d1c6072020-08-13 15:10:18 -0700215 if [ -n "$DEQP_EXPECTED_RENDERER" -a "x$DEVICENAME" != "x$DEQP_EXPECTED_RENDERER" ]; then
Eric Anholt33e08212020-05-26 10:53:05 -0700216 echo "Expected deviceName $DEQP_EXPECTED_RENDERER"
217 exit 1
218 fi
219}
220
Rob Clarkfdaf7772019-11-17 11:33:01 -0800221# wrapper to supress +x to avoid spamming the log
222quiet() {
223 set +x
224 "$@"
225 set -x
226}
227
Tomeu Vizosoad3ef6d2020-04-01 09:17:25 +0200228if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
229 # deqp is to use virpipe, and virgl_test_server llvmpipe
230 export GALLIUM_DRIVER="$GALLIUM_DRIVER"
231
Tomeu Vizoso2102d5e2020-05-12 10:18:48 +0200232 VTEST_ARGS="--use-egl-surfaceless"
233 if [ "$VIRGL_HOST_API" = "GLES" ]; then
234 VTEST_ARGS="$VTEST_ARGS --use-gles"
235 fi
236
Tomeu Vizosoad3ef6d2020-04-01 09:17:25 +0200237 GALLIUM_DRIVER=llvmpipe \
238 GALLIVM_PERF="nopt,no_filter_hacks" \
Tomeu Vizoso2102d5e2020-05-12 10:18:48 +0200239 virgl_test_server $VTEST_ARGS >$RESULTS/vtest-log.txt 2>&1 &
Tomeu Vizosoad3ef6d2020-04-01 09:17:25 +0200240
241 sleep 1
242fi
243
Eric Anholt33e08212020-05-26 10:53:05 -0700244if [ $DEQP_VER = vk ]; then
245 quiet check_vk_device_name
246else
Eric Anholtff118362020-03-05 14:35:55 -0800247 quiet check_renderer
248fi
249
Eric Anholtbf29daa2020-10-29 10:29:28 -0700250RESULTS_CSV=$RESULTS/results.csv
251FAILURES_CSV=$RESULTS/failures.csv
Eric Anholt951e1012020-04-17 12:58:59 -0700252
Eric Anholtbf29daa2020-10-29 10:29:28 -0700253run_cts $DEQP /tmp/case-list.txt $RESULTS_CSV
Eric Anholt46daaca2019-06-28 16:35:32 -0700254DEQP_EXITCODE=$?
255
Tomeu Vizoso74554032020-07-28 08:22:34 +0200256echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)"
257echo "# of CPU cores: $(cat /proc/cpuinfo | grep processor | wc -l)"
258
Eric Anholtbf29daa2020-10-29 10:29:28 -0700259# Remove the shader cache, no need to include in the artifacts.
260find $RESULTS -name \*.shader_cache | xargs rm -f
261
Eric Anholt7f3f9b22020-02-19 10:29:32 -0800262# junit is disabled, because it overloads gitlab.freedesktop.org to parse it.
Eric Anholtbf29daa2020-10-29 10:29:28 -0700263# quiet generate_junit $RESULTS_CSV > $RESULTS/results.xml
Rob Clark9f422cb2019-11-17 12:04:50 -0800264
Eric Anholtbf29daa2020-10-29 10:29:28 -0700265# Turn up to the first 50 individual test QPA files from failures or flakes into
266# XML results you can view from the browser.
267qpas=`find $RESULTS -name \*.qpa -a ! -name deqp-info.qpa`
268if [ -n "$qpas" ]; then
269 shard_qpas=`echo "$qpas" | grep dEQP- | head -n 50`
270 for qpa in $shard_qpas; do
271 xml=`echo $qpa | sed 's|\.qpa|.xml|'`
272 /deqp/executor/testlog-to-xml $qpa $xml
273 done
Rob Clarkfdaf7772019-11-17 11:33:01 -0800274
Eric Anholtbf29daa2020-10-29 10:29:28 -0700275 cp /deqp/testlog.css "$RESULTS/"
276 cp /deqp/testlog.xsl "$RESULTS/"
Eric Anholt30da82c2020-08-19 10:30:12 -0700277
Eric Anholtbf29daa2020-10-29 10:29:28 -0700278 # Remove all the QPA files (extracted or not) now that we have the XML we want.
279 echo $qpas | xargs rm -f
Eric Anholt7859eb12019-09-12 12:34:50 -0700280fi
Rob Clark59ed90f2019-11-17 11:16:09 -0800281
Eric Anholtbf29daa2020-10-29 10:29:28 -0700282# Report the flakes to the IRC channel for monitoring (if configured):
283quiet report_flakes $RESULTS_CSV
284
Rob Clark59ed90f2019-11-17 11:16:09 -0800285exit $DEQP_EXITCODE