Skip to content

Commit d2d3957

Browse files
committed
fix: Check for empty summary file in regression to avoid errors outside of CI
1 parent f6f62e4 commit d2d3957

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

regression.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ def run_reg_test(name, **kwargs):
143143
only_target=args.only_target,
144144
)
145145
reg_res[n] = t
146-
146+
147147
summary_file = os.environ.get("GITHUB_STEP_SUMMARY")
148-
with open(summary_file, "w") as f:
149-
s = ""
150-
s += "# Regression Test Result\n"
151-
for k, v in reg_res.items():
152-
s += f"{k}: {v}\n"
153-
f.write(s)
148+
if summary_file is not None:
149+
with open(summary_file, "w") as f:
150+
s = ""
151+
s += "# Regression Test Result\n"
152+
for k, v in reg_res.items():
153+
s += f"{k}: {v}\n"
154+
f.write(s)
154155

155156

156157
if __name__ == "__main__":

0 commit comments

Comments
 (0)