Skip to content

Commit 1222c34

Browse files
committed
Full annotations from worker
1 parent 75c44b0 commit 1222c34

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎Lib/test/libregrtest/utils.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,22 @@ def escape(text: str) -> str:
187187
def escape_property(text: str) -> str:
188188
return escape(text).replace(":", "%3A").replace(",", "%2C")
189189

190-
message = decolor(message)
190+
message = decolor(message).rstrip()
191191
props: dict[str, str | int] = {}
192+
header = title
192193
if location := traceback_location(message):
193194
props |= location
195+
position = ":".join(str(location[key])
196+
for key in ("file", "line", "col")
197+
if key in location)
198+
header = f"{position}: {title}"
194199
props["title"] = title
200+
# The job log only shows the message, not the properties: start the
201+
# message with the location and the title
202+
message = f"{header}\n{message}"
195203
props_text = ",".join(f"{key}={escape_property(str(value))}"
196204
for key, value in props.items())
197-
return f"::error {props_text}::{escape(message.rstrip())}"
205+
return f"::error {props_text}::{escape(message)}"
198206

199207

200208
def regrtest_unraisable_hook(unraisable) -> None:

0 commit comments

Comments
 (0)