Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clojure.test: readable stacktraces #1518

Open
pesterhazy opened this issue Mar 11, 2023 · 0 comments · May be fixed by #1519
Open

clojure.test: readable stacktraces #1518

pesterhazy opened this issue Mar 11, 2023 · 0 comments · May be fixed by #1519

Comments

@pesterhazy
Copy link

Tests using clojure.test print sci-unaware stacktraces. When an exception happens, the stacktrace contains no reference to the sci functions (only internals). E.g.

user=> (require '[clojure.test :as t]) (defn myfun [] (throw (Exception. "boom"))) (t/deftest t (t/is (= 0 (f)))) (t)
ERROR in (t) (<repl>:15)
expected: (= 0 (f))
  actual: java.lang.Exception: boom
 at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:500)
    java.lang.reflect.Constructor.newInstance (Constructor.java:484)
    sci.impl.Reflector.invokeConstructor (Reflector.java:310)
...

Instead, I would expect to see a sci-aware stacktrace with meaningful files and line numbers.

Describe alternatives you've considered
The problem could be fixed in a number of places. For example, in this gist I tried to monkey-patch a better stack printer into the clojure.test/report function.

However, two approaches are probably better:

  • Update clojure.test (without monkey-patching)
  • Update clojure.stacktrace
@pesterhazy pesterhazy linked a pull request Mar 11, 2023 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant