Skip to content

Split the s2 journey into one test per contract - #478

Merged
yansfil merged 1 commit into
mainfrom
test/split-s2-contracts
Oct 5, 2026
Merged

yansfil merged 1 commit into
mainfrom
test/split-s2-contracts

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

web/e2e/s2.spec.ts의 test 하나(440줄, expect 132개)가 checkout, 탭, split, wheel, 클릭, 선택, zoom, 메뉴, sheet, 재연결을 이어 붙여 검사했습니다.
Windows에서 두 시도가 모두 실패하면(#424 zoom 지연, #475 less 뒤 프롬프트) 그 뒤의 계약 검사도 함께 사라지고 Windows e2e를 타는 PR이 전부 막혔습니다.
계약마다 자기 stack(startFlow)에서 시작하는 test 10개로 나눴습니다. 단언은 옮기기만 했고, 앞 단계 상태에 기대던 곳만 setup으로 바꿨습니다.
#475(less)와 #424(zoom)는 각자의 test로 떨어져 나갔고 고치지 않았습니다.

Review

test 계약
1 checkout 전환은 focus_checkout 1회, 평범한 폴더의 Overview 왕복
2 탭 전환, ⌥T create_tab, ⌥` agent 순환, 탭 이동(agent_layout.move), 탭 close 버튼
3 split_right, divider drag resize_pane 1회, close_pane(확인 없음, terminal dispose)
4 shell wheel terminal_scroll, 클릭 terminal_click와 SGR 보고(key 이벤트 없음)
5 alternate screen(less) wheel (#475, 단언 그대로)
6 드래그 선택은 클릭이 아님, 복사의 줄 잇기와 들여쓰기
7 세 pane 중 focus outline, zoom chord와 chip (#424)
8 우클릭 focus, terminal menu, Zoom pane이 canvas를 채움
9 단축키 sheet(moved chords, Escape가 key를 보내지 않음), ⌘F agent find
10 echo, 탭 떠날 때 터미널 park, 소켓 끊김 복구

의도한 변경: 탭 전환 test의 탭 수, 클릭 test 끝의 shell 재포커스와 focus_pane == +2 단언(드래그 단계에서 옮김), less test의 terminal_scroll이 1부터 셈, 각 test 앞에 agent 준비(claude) 대기가 setup으로 들어감.

Evidence

  • 확인한 것: macOS 로컬, 고정 Herdr 0.9.1, 분할 전 1 test 21.6초, 15개 안 150초, 최종 10개 102초(세 번 모두 10/10 통과). web typecheck, web lint(크기 검사 포함)
  • CI 실측 (이 PR run 37273686817, 전은 같은 base 104c2eeb의 main run 37271288128): s2만 본 시간이고 두 run 모두 재시도 없이 통과했습니다.
lane 전: s2.spec.ts:55 한 줄 후: s2 test 10개 합 (test당 범위) lane job 전체 전 -> 후
Linux shard 3/6 21.0초 105.0초 (9.2~12.6초) 461초 -> 390초
macOS web e2e 28.1초 122.6초 (10.3~14.2초) 481초 -> 516초
Windows web e2e 29.5초 129.2초 (11.2~14.9초) 572초 -> 662초
  • s2 합은 lane마다 약 44.5배, 늘어난 시간은 Linux +84초, macOS +94초, Windows +100초입니다. test당 약 810초의 stack 시작이 대부분입니다.
  • lane job 전체는 macOS +35초, Windows +90초로 늘었고 Linux shard 3/6은 줄었습니다. shard를 나누는 배치와 runner 편차가 섞여서 이 열은 s2 몫만이 아닙니다.
  • 확인하지 못한 것: 이 PR의 Windows 통과가 Flaky e2e: s2가 checkout, 탭, split 여정 중 탭 수를 놓침 (Linux) #424/#475의 원인이 사라졌다는 증거는 아닙니다. 두 번째 시도 없이 한 번에 통과했을 뿐이고, 분할이 한 계약의 실패를 다른 계약에서 떼어 놓는다는 점만 이 PR이 주장합니다.
D3 before after
test 수 1 10
test당 줄 / expect (가장 큰 것) 440 / 132 84 / 22
size baseline 항목 20 (s2 포함) 19
startFlow(Herdr + hided + page) 한 번 약 8.1초 약 8.1초 (test당)
s2 전체 시간 (macOS 로컬) 21.6초 약 102초 (15개 안: 150초)

setup이 test당 약 8.1초로 시간의 대부분입니다. 합치면 격리가 줄어서 #475, #424와 서로 다른 표면만 따로 두고 나머지 작은 계약 쌍은 한 test로 묶었습니다.

Verification record
  • 리뷰 subagent Fix now 2건 반영: splitShell이 Herdr의 focus 확인(pane current)까지 기다리고 고정 1초 settledFocus 4곳을 뺐고, 탭 close 뒤 첫 탭의 pane 2개 단언을 되살렸습니다.
  • Follow-up(미반영): 재연결 test가 부팅 상태로 되돌아오므로 끊기 전에 상태를 하나 바꾸면 더 강해집니다. 모든 stack이 beta와 탭 두 개를 만듭니다. @platform lane이 stack 10개를 띄우므로 Windows lane 시간을 확인하세요.
  • 로컬: verify-web.sh web lint(크기 검사 포함), web typecheck, e2e/s2.spec.ts 10/10.

Each test starts from its own stack, so a contract that fails on one platform no longer takes the assertions after it down, and the s2 entry leaves the test size baseline.
@yansfil
yansfil merged commit 68b0e16 into main Oct 5, 2026
28 checks passed
@yansfil
yansfil deleted the test/split-s2-contracts branch October 5, 2026 06:56
yansfil added a commit that referenced this pull request Oct 5, 2026
…ves (#480)

Related: #478 (base branch), #475

## Summary

Contract 7 of the split s2 spec ran the system `less`, which cannot say
what reached it, and on the Windows retry (#475) the wheel and `q` had
no visible effect on it.
This replaces `less` with a small pager fixture
(`web/e2e/alt-screen-program.ts`, a `fixtureProgram` Node script) that
enters the alternate screen, logs every byte it reads, and leaves on
`q`.
The test now asserts the exact bytes the PTY got: one cursor key per
wheel batch (down, then up) and `q`, nothing else, and that the shell
prompt returns after the alternate screen closes.

## Review

- **판단해 주세요**: the expected bytes `ESC[B ESC[A q` are what Herdr 0.9.1
sends on macOS for a wheel over a non-mouse alternate screen, one key
per batch whatever its lines (15, 150 and 1 lines all gave one key); if
Windows differs, the failure prints the actual bytes.
- **조심해서 볼 파일**: `web/e2e/s2.spec.ts` contract 7 only - every earlier
assertion is kept (two `terminal_scroll`, direction, no key event for
the wheel, prompt returns); new ones are added.
- **질문**: #475 stays open until a Windows run shows whether `q` reached
the PTY.

## Evidence

- **확인한 것**: contract 7 passed 3 of 3 on macOS against the #478 build;
the shell-pane wheel test still passes; web typecheck and lint pass; the
fixture ran under a pty with `ESC[B ESC[A q` and logged them verbatim.
- **확인하지 못한 것**: Windows (the program runs through the `fixtureProgram`
launcher there); CI is the only check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant