test(smoke): drive quickstart through to the token-mint prompt#336
Open
tildesrc wants to merge 10 commits into
Open
test(smoke): drive quickstart through to the token-mint prompt#336tildesrc wants to merge 10 commits into
tildesrc wants to merge 10 commits into
Conversation
Extend the smoke workflow beyond "services come up" to run the real `panopticon quickstart` — doctor gate, repo registration, and the setup-repo shell task — and assert it reaches the `claude setup-token` mint prompt (the last step before the interactive OAuth CI can't do). doctor requires `claude` (absent on both runners) and a reachable `docker` daemon (absent on macOS); it only checks binary presence and `docker info`'s exit code, so a stub bin on PATH satisfies it. The setup-repo task is a shell workflow, so nothing after the gate needs real docker to reach the mint prompt. Keep real docker on Linux. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The macOS runner never observed the setup-repo shell session at the mint prompt. Dump the task's final state, tmux sessions, pane history, and runner/service logs on failure to pin down whether the session was never created or ran to completion (read got EOF). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The setup-repo task stays RUNNING on macOS with no session, so its shell pane exits mid-script. Set tmux remain-on-exit so the dead pane persists, and always dump the pane scrollback, to capture the exact error (macOS /bin/sh is bash 3.2 vs ubuntu's dash). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`detach=$(... awk '... print $(NF - 1) ...')` nests a `(` inside the
outer command substitution, which macOS /bin/sh (bash 3.2) mis-parses
("syntax error near unexpected token `('"), killing the setup-repo
shell task before it prompts. Assign `i = NF - 1` and `print $i` so the
substitution has no nested parens; behaviour is unchanged on Linux.
Uncovered by the extended smoke test now driving quickstart through the
token-mint prompt on macos-latest. Revert its diagnostics to a clean
failure-only dump.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The detach-key fix cleared the first bash-3.2 parse error, but the macOS shell task still exits mid-script. Re-add remain-on-exit to capture the next error's pane output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The real bash-3.2 trip was a double-quoted string nested inside the
`awk '…'` program inside the `$(…)` command substitution — bash 3.2's
command-substitution parser mishandles the nested quotes and dies with
"syntax error near `('". Pass "detach-client" via `awk -v k=` so the
program carries no nested quotes. Behaviour unchanged on Linux.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The true bash-3.2 trip (reproduced locally with BASH_COMPAT=3.2) was the
apostrophe in `${PANOPTICON_ENV_FILE:-the repo's env-file}`: a `'` inside
a `${…:-default}` default within a double-quoted string derails macOS
/bin/sh's quote tracking, so it mis-parses the rest of the script and
dies at a later `(`. Reword the fallback without an apostrophe.
Revert the earlier detach-line edits (a wrong diagnosis — that line
parses fine on bash 3.2) so the only script change is this one line.
Drop the smoke test's temporary dead-pane diagnostic.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…kstart-mint # Conflicts: # src/panopticon/workflows/setup_repo.sh
Encapsulate the smoke test's pass/fail check — wait for the setup-repo task, poll its host tmux pane for the `claude setup-token` mint prompt, exit 0 on success or 1 with diagnostics — as a single command, so the CI step is `panopticon smoketest` instead of an inline shell+python heredoc. It's a CI-only helper: kept out of `panopticon --help` (no subparser help + excluded from the subcommands metavar). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`panopticon quickstart` already starts the task service + runner (the same detached tmux sessions and logs `make host` produces), so drop the separate `make host` step and let quickstart bring everything up. Fold the health-check and session-verify into the quickstart step, which backgrounds quickstart and then asserts via `panopticon smoketest`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the smoke workflow beyond "the services come up" to exercise the quickstart flow, running the real
panopticon quickstartand asserting it reaches the token-mint prompt — the last step before the interactiveclaude setup-tokenOAuth that CI can't complete.How
claude/dockerso the doctor gate passes.panopticon quickstartgates onpanopticon doctor, which requiresclaude(absent on both runners) and a reachabledockerdaemon (absent on macOS). doctor only checks binary presence (which) anddocker info's exit code, so a#!/bin/sh; exit 0stub onPATHsatisfies it.claudeis stubbed on both OSes;dockeronly on macOS (ubuntu-latest keeps its real daemon).setup-repotask, which the runner spawns viaShellRunner(no image, no container). The realsetup_repo.shruns and stops atmint one with 'claude setup-token'. Theclaudestub is never invoked — the flow halts before the Enter that would run it.CLAUDE_CODE_OAUTH_TOKEN/ANTHROPIC_API_KEYso the script takes the mint path rather than the "adopt a token from your environment" path.tmux attach), which no-TTYs out in CI and returns; it's backgrounded so a stuck attach can't wedge the job, and killed once the assertion is made. The smoke then polls thepanopticon-<task_id>pane for the mint string.Runs on
ubuntu-latestandmacos-latest, so the realsetup_repo.shis exercised on macOS too.