Skip to content

Commit

Permalink
Merge d99f447 into 37cf155
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk authored Sep 6, 2024
2 parents 37cf155 + d99f447 commit 15da610
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/actions/test_ya/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,17 @@ runs:
echo $CURRENT_MESSAGE | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py

CURRENT_JUNIT_XML_PATH=$CURRENT_PUBLIC_DIR/junit.xml
CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.txt
CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.json
set +ex
(./ya make $YA_MAKE_TARGET "${params[@]}" \
$RERUN_FAILED_OPT --log-file "$PUBLIC_DIR/ya_log.log" \
--evlog-file "$CURRENT_PUBLIC_DIR/ya_evlog.jsonl" \
--junit "$CURRENT_JUNIT_XML_PATH" --build-results-report $CURRENT_REPORT --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
--junit "$CURRENT_JUNIT_XML_PATH" --build-results-report "$CURRENT_REPORT" --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
set -ex
RC=`cat exit_code`

.github/scripts/tests/report_analyzer.py "$CURRENT_REPORT" $CURRENT_PUBLIC_DIR/summary_report.txt || true

# convert to chromium trace
# seems analyze-make don't have simple "output" parameter, so change cwd
ya_dir=$(pwd)
Expand Down
31 changes: 31 additions & 0 deletions .github/scripts/tests/report_analyzer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3

"""
The tool used to analyze file created by "ya make ... --build-results-report <file>"
"""

import sys
import json

if __name__ == "__main__":
report_path = sys.argv[1]
summary_path = sys.argv[2]

with open("report_path") as f:
obj = json.loads(f.read())

all = []

for result in obj["results"]:
type_ = result["type"]
if type_ == "test" and result.get("chunk"):
rss_consumtion = result["metrics"].get("suite_max_proc_tree_memory_consumption_kb", 0) / 1024 / 1024
path = result["path"] + " " + result.get("subtest_name", "")
all.append((rss_consumtion, path))

all.sort()
with open (summary_path, "w") as f:
f.write("RSS usage by tests, sorted\n\n")
for rss, path in all:
f.write("{} {%.2f} GiB \n".format(path, rss))
f.write("\n")

0 comments on commit 15da610

Please sign in to comment.