-
Notifications
You must be signed in to change notification settings - Fork 10
Prettier test reports #72
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
Conversation
| (defn -main [& args] | ||
| (assert (string? (first args)) (print-str "first argument must be a string, got" args)) | ||
| (let [the-ns (-> args first symbol)] | ||
| (println "testing" the-ns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant, see that pretty-report for :begin-test-ns already does this.
INFO: From Testing //test:clj_kondo_test.test:
==================== Test output for //test:clj_kondo_test.test:
testing clj-kondo-test
Testing clj-kondo-test
| (zero? (:error test-report))) | ||
| (System/exit 0) | ||
| (System/exit 1))) | ||
| (binding [c.test/report pretty-report] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clojure.test namespace advises rebinding report to achieve this functionality. https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj#L211-L212
| (def old-handler | ||
| (Signal/handle | ||
| (Signal. "TERM") | ||
| (reify SignalHandler | ||
| (handle [_ signal] | ||
| (run! println (.dumpAllThreads (ManagementFactory/getThreadMXBean) true true)) | ||
| (when-not (#{SignalHandler/SIG_DFL SignalHandler/SIG_IGN} old-handler) | ||
| (.handle old-handler signal)))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't appear to be used anywhere.
We've overridden the default report functionality that Clojure's
clojure.testnamespace provides to print more easily readable values, especially when those values are maps.