/
mark-failing-reftests.sh
executable file
·60 lines (55 loc) · 2.42 KB
/
mark-failing-reftests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Point this to your root source directory
MOZILLA_SRC=$HOME/zspace/mozilla-w2
## Put all the raw reftest logfiles into $PWD with a .log extension.
## generate list of failures in a easy-to-use format
awk '/UNEXPECTED-FAIL/ { print $10, $9, $11 }' *.log |
while read op f1 f2; do
if [ $op == "|" -o $f1 == "|" ]; then
continue
fi
echo $op $f1 $f2
done |
sed -e "s#file:///home/worker/workspace/build/tests/reftest/tests/##g" |
sed -e "s#http://localhost:[0-9/]*/##" > failures
## ensure that all the failures can be located in the reftest files
## if this chunk outputs any filenames, it means they could not be found
cat failures |
while read op f1 f2; do
folder=${f1%/*}
subfolder=${folder##*/}
pushd $MOZILLA_SRC/$folder >/dev/null
ls reftest*.list | grep -v stylo | xargs grep "$op ${f1##*/} * ${f2##$folder/}" > /dev/null
if [ $? -eq 0 ]; then
popd >/dev/null
continue
fi
ls reftest*.list | grep -v stylo | xargs grep "$op ${f1##*/} * ${f2##$subfolder/}" > /dev/null
if [ $? -eq 0 ]; then
popd >/dev/null
continue
fi
echo "ERROR LOCATING $folder ${f1##*/} ${f2##$folder/}"
popd >/dev/null
done
## do the reftest updates once the above is clean
cat failures |
while read op f1 f2; do
folder=${f1%/*}
subfolder=${folder##*/}
pushd $MOZILLA_SRC/$folder >/dev/null
# put the fails-if just before the $op
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@\($op ${f1##*/} * ${f2##$folder/}\)@fails-if(webrender) \1@"
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@\($op ${f1##*/} * ${f2##$subfolder/}\)@fails-if(webrender) \1@"
# deduplicate
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@fails-if(webrender) fails-if(webrender)@fails-if(webrender)@"
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@fails-if(webrender) fails-if(webrender)@fails-if(webrender)@"
# if there is an HTTP on the line, move the fails-if to before that
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@\(HTTP.*\) fails-if(webrender)@fails-if(webrender) \1@"
# more deduplicate (there can be duplication here, not sure why)
ls reftest*.list | grep -v stylo | xargs sed -i -e "s@fails-if(webrender) fails-if(webrender)@fails-if(webrender)@"
popd >/dev/null
done
## ensure this shows nothing:
pushd $MOZILLA_SRC >/dev/null
find . -name reftest*.list | xargs grep "fails-if(webrender) fails-if(webrender)"
popd >/dev/null