File tree Expand file tree Collapse file tree 2 files changed +49
-2
lines changed Expand file tree Collapse file tree 2 files changed +49
-2
lines changed Original file line number Diff line number Diff line change @@ -340,15 +340,17 @@ runs:
340
340
echo $CURRENT_MESSAGE | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
341
341
342
342
CURRENT_JUNIT_XML_PATH=$CURRENT_PUBLIC_DIR/junit.xml
343
- CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.txt
343
+ CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.json
344
344
set +ex
345
345
(./ya make $YA_MAKE_TARGET "${params[@]}" \
346
346
$RERUN_FAILED_OPT --log-file "$PUBLIC_DIR/ya_log.log" \
347
347
--evlog-file "$CURRENT_PUBLIC_DIR/ya_evlog.jsonl" \
348
- --junit "$CURRENT_JUNIT_XML_PATH" --build-results-report $CURRENT_REPORT --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
348
+ --junit "$CURRENT_JUNIT_XML_PATH" --build-results-report " $CURRENT_REPORT" --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
349
349
set -ex
350
350
RC=`cat exit_code`
351
351
352
+ .github/scripts/tests/report_analyzer.py --report_file "$CURRENT_REPORT" --summary_file $CURRENT_PUBLIC_DIR/summary_report.txt || true
353
+
352
354
# convert to chromium trace
353
355
# seems analyze-make don't have simple "output" parameter, so change cwd
354
356
ya_dir=$(pwd)
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ The tool used to analyze file created by "ya make ... --build-results-report <file>"
5
+ """
6
+
7
+ import argparse
8
+ import sys
9
+ import json
10
+
11
+ if __name__ == "__main__" :
12
+ parser = argparse .ArgumentParser ()
13
+ parser .add_argument (
14
+ "--report_file" ,
15
+ help = "path to file received via 'ya make ... --build-results-report <file>'" ,
16
+ type = argparse .FileType ("r" ),
17
+ required = True
18
+ )
19
+ parser .add_argument (
20
+ "--summary_file" ,
21
+ help = "output file for summary" ,
22
+ type = argparse .FileType ("w" ),
23
+ default = "-"
24
+ )
25
+ args = parser .parse_args ()
26
+
27
+ report_file = args .report_file
28
+ summary_file = args .summary_file
29
+
30
+ obj = json .load (report_file )
31
+
32
+ all = []
33
+
34
+ for result in obj ["results" ]:
35
+ type_ = result ["type" ]
36
+ if type_ == "test" and result .get ("chunk" ):
37
+ rss_consumtion = result ["metrics" ].get ("suite_max_proc_tree_memory_consumption_kb" , 0 ) / 1024 / 1024
38
+ path = result ["path" ] + " " + result .get ("subtest_name" , "" )
39
+ all .append ((rss_consumtion , path ))
40
+
41
+ all .sort ()
42
+ summary_file .write ("RSS usage by tests, sorted\n \n " )
43
+ for rss , path in all :
44
+ summary_file .write ("{} {:.2f} GiB\n " .format (path , rss ))
45
+ summary_file .write ("\n " )
You can’t perform that action at this time.
0 commit comments