lambdaisland / lambdaisland/kaocha

Bypassing capture-output has unexpected behavior when running in REPL

Open
#446 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
860
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Using the capture/bypass macro works as expected when running tests in the CLI. When running in the REPL (e.g. via cider-jack-in), however, I'm finding that the behavior is not as I would have expected. Namely, the fact that output goes directly to the process stdout/stderr streams means that when running tests in the REPL, output from this macro goes to the NREPL server's output buffer. Ideally this output would instead be written to the writers that NREPL installs in order to capture output, to be returned to the NREPL client and displayed in the Cider buffer.

One potential approach here would be to make the previous bindings for *out* and *err* available via bindings, and have the bypass macro detect and restore these rather than always going to the process file descriptors.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the capture/bypass behavior through the REPL using cider-jack-in, then compare it with the CLI behavior described in the issue. Trace how the macro handles output and how NREPL installs its writers; done means bypassed output is returned to the NREPL client and displayed in the Cider buffer instead of the server output buffer.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.