-
Notifications
You must be signed in to change notification settings - Fork 0
/
ng-bot
executable file
·90 lines (85 loc) · 2.56 KB
/
ng-bot
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
#
# "ng-bot 168" will download the 168 result from the layout_ng bot and update
# the expectation file.
#
# You should be in the "third_party/WebKit" directory, or set "WEBKIT" variable
# to the directory.
#
# # Regular maintenance
#
# 1. Find recent green bot results at:
# https://luci-milo.appspot.com/buildbot/tryserver.chromium.linux/linux_layout_tests_layout_ng/
# 2. Let's say build #125 and 127 are green. Run following commands:
# ```bash
# $ ng-bot 125 127
# $ ng-bot upload
# ```
# 3. Review the CL and land it.
#
# ## If bot test results page say "Tests exit early"
#
# Bots exit at certain number of crashes or timeouts. See crbug.com/714203
# When this occurs, downloading results from bots is time consuming. You get
# only first 100 failures or so. After you ran a regular maintenance, you'll
# get next 100.
#
# In such case, you can run tests locally, and update expectations from it.
#
# 1. Run tests locally.
# 2. Run following commands:
# ```bash
# $ ng-bot
# $ git jobs -a
# $ ng-bot upload
# ```
# 3. Review the CL and land it.
#
# # Remove fixed tests (optional maintenance)
#
# Since many tests are flaky at this point, the script handles unexpected passes
# as flaky, not as fixed; i.e., it adds [ Failure Pass ] rather than remove.
#
# The following maintenance detects certain number of consecutive passes and
# remove them from expectations.
#
# 1. Download recent success results from bots. If you run regular maintenance,
# they should be already downloaded in ~/ng-bot/.
# 2. Run following commands:
# ```bash
# $ ng-bot -d ~/ng-bot/*.json
# $ ng-bot upload
# ```
# 3. Review the CL and land it.
#
MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RESULTS_DIR=~/ng-bot
FLAG=enable-blink-features=LayoutNG
BUG=${BUG:-591099}
args=()
for arg in "$@"; do
if [[ $arg == "try" ]]; then
git cl try -B luci.chromium.try -b linux_layout_tests_layout_ng
exit
fi
if [[ $arg == up* ]]; then
COMMIT_MESSAGE=$(git log --format=%B origin..HEAD)
MESSAGE_FILE=$(mktemp --suffix=-cl-message)
cat <<EOF >>$MESSAGE_FILE
[auto] Update FlagExpectations for LayoutNG
Following bot results are included.
$COMMIT_MESSAGE
0 lines were removed and 0 lines were deflaked by consecutive
results since 0.
TBR=eae@chromium.org, mstensho@chromium.org
NOTRY=true
Bug: $BUG
EOF
git cl upload --message-file=$MESSAGE_FILE
rm $MESSAGE_FILE
git cl try -B luci.chromium.try -b linux_layout_tests_layout_ng
exit
fi
args+=("$arg")
done
(set -x; $MY_DIR/update-expectations -sv -b "$BUG" --flag "$FLAG" "${args[@]}")