Skip to content

Commit 5d85129

Browse files
committed
upload: push stuff to gist, temporarily
Signed-off-by: Conor Dooley <[email protected]>
1 parent 067770f commit 5d85129

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pw_upload.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import configparser
88
import os
99
import signal
10+
import subprocess
1011
import inotify_simple as inotify
1112

1213
from core import NIPA_DIR
@@ -68,6 +69,17 @@ def _pw_upload_results(series_dir, pw, config):
6869
continue
6970

7071
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+
7183
series_results.append(tr)
7284

7385
break
@@ -86,6 +98,17 @@ def _pw_upload_results(series_dir, pw, config):
8698
for _, test_dirs, _ in os.walk(patch_dir):
8799
for test in test_dirs:
88100
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+
89112
pw.post_check(patch=patch, name=tr.test, state=tr.state, url=tr.url,
90113
desc=tr.desc)
91114

0 commit comments

Comments
 (0)