kit-clj / kit-clj/kit

issue: Cannot run tests when dev server is running

Open
#192 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
558
Forks
56
PR merge metrics
No merged PRs in 30d

Description

I think this creates a lot of friction in testing and development.

Being able to run tests with bb test-watch and the dev server along eachother to get constant feedback is a great tool.

Reproduction

bb dev

then write (go) in the repl to start the undertow server, then

bb test

You get

[(..............)(....)(.........................)(..............................)(..................)(..................Execution error (NullPointerException) at kit.edge.server.undertow/stop (undertow.clj:16).
Cannot invoke "Object.getClass()" because "target" is null

Full report at:
/tmp/clojure-6851726292702607279.edn
Error while executing task: test

The problem is that both bb dev and bb test want to run a server on port 3000 by default.
This can be fixed by doing bb dev and then PORT=3001 bb test so the test profile uses another port. This should be preferably handled automatically.

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

Reproduce the conflict with bb dev, (go), and bb test, then inspect undertow.clj around line 16 and the test profile invoked by bb test. Verify the change by running the development server and tests together without manually setting PORT, while preserving the existing test behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.