7
7
import configparser
8
8
import os
9
9
import signal
10
+ import subprocess
10
11
import inotify_simple as inotify
11
12
12
13
from core import NIPA_DIR
@@ -68,6 +69,17 @@ def _pw_upload_results(series_dir, pw, config):
68
69
continue
69
70
70
71
tr = PwTestResult (test , series_dir , f"{ result_server } /{ series } /{ test } " )
72
+
73
+ if tr .state != PatchworkCheckState .SUCCESS :
74
+ try :
75
+ cmd = [f"gh gist create -p -f $(find { series_dir } /{ test } -type f)" ]
76
+ output = subprocess .run (cmd , shell = True , capture_output = True , check = True ,
77
+ text = True )
78
+ tr .url = output .stdout .strip ()
79
+ log (f"gist created for { series_dir } /{ test } @ { tr .url } " )
80
+ except subprocess .CalledProcessError :
81
+ log (f"gist creation failed for { series_dir } /{ test } " )
82
+
71
83
series_results .append (tr )
72
84
73
85
break
@@ -86,6 +98,17 @@ def _pw_upload_results(series_dir, pw, config):
86
98
for _ , test_dirs , _ in os .walk (patch_dir ):
87
99
for test in test_dirs :
88
100
tr = PwTestResult (test , patch_dir , f"{ result_server } /{ series } /{ patch } /{ test } " )
101
+
102
+ if tr .state != PatchworkCheckState .SUCCESS :
103
+ try :
104
+ cmd = [f"gh gist create -p -f $(find { series_dir } /{ patch } /{ test } -type f)" ]
105
+ output = subprocess .run (cmd , shell = True , capture_output = True ,
106
+ check = True , text = True )
107
+ tr .url = output .stdout .strip ()
108
+ log (f"gist created for { series_dir } /{ patch } /{ test } @ { tr .url } " )
109
+ except subprocess .CalledProcessError :
110
+ log (f"gist creation failed for { series_dir } /{ patch } /{ test } " )
111
+
89
112
pw .post_check (patch = patch , name = tr .test , state = tr .state , url = tr .url ,
90
113
desc = tr .desc )
91
114
0 commit comments