Skip to content

Commit caea209

Browse files
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6 [skip ci]
1 parent 27c5ba3 commit caea209

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.ci/generate_test_report_lib.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
2727
# We hit the end of the log without finding a build failure, go to
2828
# the next log.
2929
return failures
30+
# index will point to the line that starts with Failed:. The progress
31+
# indicator is the line before this and contains a pretty printed version
32+
# of the target being built. We use this and remove the progress information
33+
# to get a succinct name for the target.
3034
failing_action = ninja_log[index - 1].split("] ")[1]
3135
failure_log = []
3236
while (
3337
index < len(ninja_log)
3438
and not ninja_log[index].startswith("[")
35-
and not ninja_log[index].startswith(
36-
"ninja: build stopped: subcommand failed"
37-
)
39+
and not ninja_log[index].startswith("ninja: build stopped:")
3840
and len(failure_log) < NINJA_LOG_SIZE_THRESHOLD
3941
):
4042
failure_log.append(ninja_log[index])
@@ -46,7 +48,7 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
4648
def find_failure_in_ninja_logs(ninja_logs: list[list[str]]) -> list[tuple[str, str]]:
4749
"""Extracts failure messages from ninja output.
4850
49-
This patch takes stdout/stderr from ninja in the form of a list of files
51+
This function takes stdout/stderr from ninja in the form of a list of files
5052
represented as a list of lines. This function then returns tuples containing
5153
the name of the target and the error message.
5254

.ci/generate_test_report_lib_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def test_find_failure_ninja_logs(self):
2727
"[2/5] test/2.stamp",
2828
"[3/5] test/3.stamp",
2929
"[4/5] test/4.stamp",
30-
"FAILED: test/4.stamp",
31-
"touch test/4.stamp",
30+
"FAILED: touch test/4.stamp",
3231
"Wow! This system is really broken!",
3332
"[5/5] test/5.stamp",
3433
],
@@ -41,8 +40,7 @@ def test_find_failure_ninja_logs(self):
4140
"test/4.stamp",
4241
dedent(
4342
"""\
44-
FAILED: test/4.stamp
45-
touch test/4.stamp
43+
FAILED: touch test/4.stamp
4644
Wow! This system is really broken!"""
4745
),
4846
),

0 commit comments

Comments
 (0)