-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] [Fix] Ensure Correct Logs Display for Go Test Logs in Build…
…kite Runner (#2837)
- Loading branch information
Showing
3 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
############################################################################### | ||
# This AWK script processes lines from test logs. | ||
# | ||
# - If a line starts with "=== RUN": | ||
# 1) Split the third field on the "/" delimiter to check if it's a subtest. | ||
# (e.g., $3 might be "Test/SomeSubtest") | ||
# 2) If it is a subtest, print as is. | ||
# (=== RUN Test/SomeSubtest) | ||
# 3) Otherwise, replace "===" with "---" (indicating a main test). | ||
# (--- RUN Test) | ||
# | ||
# - If a line contains "---" but does NOT contain "RUN", we interpret it as | ||
# non-RUN log lines. We replace "---" with "###". | ||
# ("--- PASS" to "### PASS") | ||
# | ||
# - All other lines are printed unchanged. | ||
############################################################################### | ||
|
||
# Match lines starting with "=== RUN" | ||
/^=== RUN/ { | ||
|
||
# Split the 3rd field on "/" | ||
split($3, parts, "/") | ||
|
||
# Check if more than one part was created after splitting on "/" | ||
# This indicates it's a subtest (e.g., "Test/SomeSubtest"). | ||
if (length(parts) > 1) { | ||
# For subtests, print the line unchanged | ||
} else { | ||
# If not a subtest, it's the main test. Replace "===" with "---". | ||
gsub(/===/, "---") | ||
} | ||
|
||
# Skip any further rules for this line | ||
next | ||
} | ||
|
||
# Match lines containing "---" but not containing "RUN" | ||
/---/ && !/RUN/ { | ||
|
||
# Replace "---" with "###" | ||
gsub(/---/, "###") | ||
next | ||
} | ||
|
||
# Print all other lines unchanged | ||
{ print } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters