Skip to content

Commit 09100f8

Browse files
committed
test(github): dump opencode runtime logs in e2e workflow
1 parent e72dd26 commit 09100f8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/test-comment-key.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ jobs:
3535
"Sticky comment test - run #${{ github.run_number }}, attempt #${{ github.run_attempt }}."
3636
Do not add anything else.
3737
38+
- name: Dump opencode log (sticky)
39+
if: always()
40+
run: |
41+
python3 - <<'PY'
42+
import glob
43+
import os
44+
45+
files = sorted(glob.glob(os.path.expanduser("~/.local/share/opencode/log/*.log")), key=os.path.getmtime, reverse=True)
46+
if not files:
47+
print("No opencode log files found")
48+
raise SystemExit(0)
49+
50+
path = files[0]
51+
print(f"Latest opencode log: {path}")
52+
with open(path, "r", encoding="utf-8", errors="replace") as f:
53+
print(f.read())
54+
PY
55+
3856
# Baseline: should create a new comment on every push.
3957
without-comment-key:
4058
name: Without comment_key (baseline)
@@ -61,3 +79,21 @@ jobs:
6179
Reply with exactly one sentence:
6280
"Non-sticky comment test - run #${{ github.run_number }}, attempt #${{ github.run_attempt }}."
6381
Do not add anything else.
82+
83+
- name: Dump opencode log (non-sticky)
84+
if: always()
85+
run: |
86+
python3 - <<'PY'
87+
import glob
88+
import os
89+
90+
files = sorted(glob.glob(os.path.expanduser("~/.local/share/opencode/log/*.log")), key=os.path.getmtime, reverse=True)
91+
if not files:
92+
print("No opencode log files found")
93+
raise SystemExit(0)
94+
95+
path = files[0]
96+
print(f"Latest opencode log: {path}")
97+
with open(path, "r", encoding="utf-8", errors="replace") as f:
98+
print(f.read())
99+
PY

0 commit comments

Comments
 (0)