@@ -77,22 +77,23 @@ def parse_reports(folder):
77
77
tests_by_class [class_name ].append (test_case )
78
78
return tests_by_class
79
79
80
- def build_message (test_suite ):
80
+ def build_message (test_case ):
81
81
return {
82
82
"normal" : {
83
83
"build_pr" : os .environ .get ("CIRCLE_PR_NUMBER" ),
84
84
"build_tag" : os .environ .get ("CIRCLE_TAG" ),
85
85
"build_sha1" : os .environ .get ("CIRCLE_SHA1" ),
86
86
"build_branch" : os .environ .get ("CIRCLE_BRANCH" ),
87
- "test_name" : test_suite .name ,
87
+ "test_suite_name" : test_case .class_name ,
88
+ "test_case_name" : test_case .name ,
88
89
},
89
90
"int" : {
90
91
"time" : int (time .time ()),
91
- "test_total_count" : len ( test_suite . test_cases ) ,
92
- "test_total_time" : int (test_suite . total_time * 1000 ),
93
- "test_failed_count" : test_suite . failed_count ,
94
- "test_skipped_count" : test_suite . skipped_count ,
95
- "test_errored_count" : test_suite . errored_count ,
92
+ "test_total_count" : 1 ,
93
+ "test_total_time" : int (test_case . time * 1000 ),
94
+ "test_failed_count" : 1 if test_case . failed > 0 else 0 ,
95
+ "test_skipped_count" : 1 if test_case . skipped > 0 else 0 ,
96
+ "test_errored_count" : 1 if test_case . errored > 0 else 0 ,
96
97
},
97
98
}
98
99
@@ -112,10 +113,11 @@ def send_report(reports):
112
113
[
113
114
{
114
115
"category" : "perfpipe_pytorch_test_times" ,
115
- "message" : json .dumps (build_message (reports [ name ] )),
116
+ "message" : json .dumps (build_message (test_case )),
116
117
"line_escape" : False ,
117
118
}
118
119
for name in sorted (reports .keys ())
120
+ for test_case in reports [name ].test_cases
119
121
]
120
122
),
121
123
},
0 commit comments