Deleting the human view of `daemon status` leaves the whole suite green
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli, testing-qa
Research direction
The untested branch is the human output in src/cli/index.ts around lines 1667-1668, where daemon status writes formatStatus(...) unless --json is set. Read the existing daemon start and status assertions in src/cli/index.test.ts to match their style, then add a unit test that runs daemon status without --json and expects Daemon: running (worker). Done when that test passes on the current code and fails when the human branch is replaced with the unconditional writeResult. Check #422 for the corrected it it proposes, since that work may overlap.
Written by the indexing model from the issue text.
Description
Testing rule 3: a code path that can be deleted with a green suite is untested.
I deleted the human branch of simlock daemon status in src/cli/index.ts:1667-1668 — turning
if (values.json) writeResult(environment, status);
else environment.stdout.write(`${formatStatus(status, environment.clock.now())}\n`);
into an unconditional writeResult(environment, status) — and every check stayed green:
pnpm exec vitest run --project unit src/cli/index.test.ts: 219 passed. That suite assertsDaemon: running (worker)forsimlock statusandDaemon runningforsimlock daemon start, so onlydaemon status's own human view has no unit assertion.pnpm test:e2e e2e/daemon-lifecycle.test.ts: 3 passed, 1 expected fail. The one test that namesdaemon status's default view is anit.fails, which passes whether the view exists or not.pnpm test:changed: green apart from the repro test from #422.
So the CLI publishes a human view of daemon status that no test can see. The corrected it proposed in #422 (asserting Daemon: running (worker) on daemon status with no --json) does cover it: run against this same deletion it fails with expected '{"devices":[]…' to contain 'Daemon: running (worker)'.
Found while triaging #422.
Written by an agent.
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 1
- Avg merge
- 9h 56m
- Merged PRs (30d)
- 134
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/simlock
-
bug:new
Difficulty 1/5 Under an hour Newbie friendliness 70/100
callstackincubator/simlock#430 ·
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/simlock#424 ·
Maintainers usually reply within 1 day
-
daemon-lifecycle e2e: the it.fails status test passes for the wrong reasonPossibly taken @V3RON claimed this 2 days ago. Openbug:triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
callstackincubator/simlock#422 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
task:draft
Difficulty 5/5 Over a week Newbie friendliness 8/100
callstackincubator/simlock#442 ·
Maintainers usually reply within 1 day
-
task:draft
Difficulty 4/5 3-5 days Newbie friendliness 18/100
callstackincubator/simlock#441 ·
Maintainers usually reply within 1 day
All issues in callstackincubator/simlock
Similar issues
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 65/100
lingdojo/kana-dojo#32090 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Friction: Org home and org switcher copy still say repositories and connected agents live in the personal accountPossibly taken A pull request linked to this issue is open or already merged. Openfriction
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
kentcdodds/kody#3265 ·
Maintainers usually reply within 1 day