@@ -62,6 +62,15 @@ def validate_workspace(instance, workspace, args):
62
62
% workspace )
63
63
64
64
65
+ def workspace_comment ():
66
+ if 'WORKSPACE' in os .environ :
67
+ workspace = os .environ ['WORKSPACE' ]
68
+ print ("WORKSPACE: %s" % workspace )
69
+ return os .path .join (workspace , 'comment.md' )
70
+ else :
71
+ return None
72
+
73
+
65
74
def main ():
66
75
common .debug_print ('** RUN PULL-REQUEST CPERF **' )
67
76
os .chdir (os .path .dirname (__file__ ))
@@ -70,6 +79,11 @@ def main():
70
79
instances = [NEW_INSTANCE , OLD_INSTANCE ]
71
80
configs = get_configs (args .suite )
72
81
82
+ ws_comment = workspace_comment ()
83
+ if ws_comment is not None :
84
+ with open (ws_comment , 'w' ) as f :
85
+ f .write ("Compilation-performance test failed" )
86
+
73
87
for instance in instances :
74
88
workspace = get_workspace_for_instance (instance , args )
75
89
@@ -85,19 +99,16 @@ def main():
85
99
86
100
regressions = analyze_results (configs , args )
87
101
88
- # Temporary hack to write output to workspace when in CI,
102
+ # Crude hack to write output to workspace when in CI,
89
103
# regardless of --output passed.
90
- if 'WORKSPACE' in os .environ :
91
- workspace = os .environ ['WORKSPACE' ]
92
- print ("WORKSPACE: %s" % workspace )
93
- p = os .path .join (workspace , 'comment.md' )
94
- o = os .path .abspath (os .path .join (os .getcwd (),
95
- args .output .name ))
96
- print ("Output written to: %s" % o )
97
- if o != p :
98
- print ("Copying %s to %s" % (o , p ))
104
+ if ws_comment is not None :
105
+ out = os .path .abspath (os .path .join (os .getcwd (),
106
+ args .output .name ))
107
+ print ("Output written to: %s" % out )
108
+ if out != ws_comment :
109
+ print ("Copying %s to %s" % (out , ws_comment ))
99
110
args .output .close ()
100
- shutil .copyfile (o , p )
111
+ shutil .copyfile (out , ws_comment )
101
112
102
113
return regressions
103
114
0 commit comments