summaryrefslogtreecommitdiffstats
path: root/testing/mozharness/mozharness/mozilla/testing/errors.py
blob: 84c00b0a8b6c082a7e39e0bbd00d6a7174bf3e96 (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
"""Mozilla error lists for running tests.

Error lists are used to parse output in mozharness.base.log.OutputParser.

Each line of output is matched against each substring or regular expression
in the error list.  On a match, we determine the 'level' of that line,
whether IGNORE, DEBUG, INFO, WARNING, ERROR, CRITICAL, or FATAL.

"""

import re

from mozharness.base.log import ERROR, INFO, WARNING

# ErrorLists {{{1
_mochitest_summary = {
    "regex": re.compile(
        r"""(\d+ INFO (Passed|Failed|Todo):\ +(\d+)|\t(Passed|Failed|Todo): (\d+))"""
    ),  # NOQA: E501
    "pass_group": "Passed",
    "fail_group": "Failed",
    "known_fail_group": "Todo",
}

_reftest_summary = {
    "regex": re.compile(
        r"""REFTEST INFO \| (Successful|Unexpected|Known problems): (\d+) \("""
    ),  # NOQA: E501
    "pass_group": "Successful",
    "fail_group": "Unexpected",
    "known_fail_group": "Known problems",
}

TinderBoxPrintRe = {
    "mochitest-chrome_summary": _mochitest_summary,
    "mochitest-webgl1-core_summary": _mochitest_summary,
    "mochitest-webgl1-ext_summary": _mochitest_summary,
    "mochitest-webgl2-core_summary": _mochitest_summary,
    "mochitest-webgl2-ext_summary": _mochitest_summary,
    "mochitest-webgl2-deqp_summary": _mochitest_summary,
    "mochitest-webgpu_summary": _mochitest_summary,
    "mochitest-media_summary": _mochitest_summary,
    "mochitest-plain_summary": _mochitest_summary,
    "mochitest-plain-gpu_summary": _mochitest_summary,
    "marionette_summary": {
        "regex": re.compile(r"""(passed|failed|todo):\ +(\d+)"""),
        "pass_group": "passed",
        "fail_group": "failed",
        "known_fail_group": "todo",
    },
    "reftest_summary": _reftest_summary,
    "reftest-qr_summary": _reftest_summary,
    "crashtest_summary": _reftest_summary,
    "crashtest-qr_summary": _reftest_summary,
    "xpcshell_summary": {
        "regex": re.compile(r"""INFO \| (Passed|Failed|Todo): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": "Todo",
    },
    "jsreftest_summary": _reftest_summary,
    "instrumentation_summary": _mochitest_summary,
    "cppunittest_summary": {
        "regex": re.compile(r"""cppunittests INFO \| (Passed|Failed): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": None,
    },
    "gtest_summary": {
        "regex": re.compile(r"""(Passed|Failed): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": None,
    },
    "jittest_summary": {
        "regex": re.compile(r"""(Passed|Failed): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": None,
    },
    "mozbase_summary": {
        "regex": re.compile(r"""(OK)|(FAILED) \(errors=(\d+)"""),
        "pass_group": "OK",
        "fail_group": "FAILED",
        "known_fail_group": None,
    },
    "geckoview_summary": {
        "regex": re.compile(r"""(Passed|Failed): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": None,
    },
    "geckoview-junit_summary": {
        "regex": re.compile(r"""(Passed|Failed): (\d+)"""),
        "pass_group": "Passed",
        "fail_group": "Failed",
        "known_fail_group": None,
    },
    "harness_error": {
        "full_regex": re.compile(
            r"(?:TEST-UNEXPECTED-FAIL|PROCESS-CRASH) \| .* \|[^\|]* (application crashed|missing output line for total leaks!|negative leaks caught!|\d+ bytes leaked)"  # NOQA: E501
        ),
        "minimum_regex": re.compile(r"""(TEST-UNEXPECTED|PROCESS-CRASH)"""),
        "retry_regex": re.compile(
            r"""(FAIL-SHOULD-RETRY|No space left on device|ADBError|ADBProcessError|ADBTimeoutError|program finished with exit code 80|INFRA-ERROR)"""  # NOQA: E501
        ),
    },
}

TestPassed = [
    {
        "regex": re.compile("""(TEST-INFO|TEST-KNOWN-FAIL|TEST-PASS|INFO \| )"""),
        "level": INFO,
    },
]

BaseHarnessErrorList = [
    {
        "substr": "TEST-UNEXPECTED",
        "level": ERROR,
    },
    {
        "substr": "PROCESS-CRASH",
        "level": ERROR,
    },
    {
        "regex": re.compile("""ERROR: (Address|Leak)Sanitizer"""),
        "level": ERROR,
    },
    {
        "regex": re.compile("""thread '([^']+)' panicked"""),
        "level": ERROR,
    },
    {
        "substr": "pure virtual method called",
        "level": ERROR,
    },
    {
        "substr": "Pure virtual function called!",
        "level": ERROR,
    },
]

HarnessErrorList = BaseHarnessErrorList + [
    {
        "substr": "A content process crashed",
        "level": ERROR,
    },
]

# wpt can have expected crashes so we can't always turn treeherder orange in those cases
WptHarnessErrorList = BaseHarnessErrorList

LogcatErrorList = [
    {
        "substr": "Fatal signal 11 (SIGSEGV)",
        "level": ERROR,
        "explanation": "This usually indicates the B2G process has crashed",
    },
    {
        "substr": "Fatal signal 7 (SIGBUS)",
        "level": ERROR,
        "explanation": "This usually indicates the B2G process has crashed",
    },
    {"substr": "[JavaScript Error:", "level": WARNING},
    {
        "substr": "seccomp sandbox violation",
        "level": ERROR,
        "explanation": "A content process has violated the system call sandbox (bug 790923)",
    },
]