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

nedap.utils.spec.print-stack-frames option #13

Merged
merged 3 commits into from
Oct 6, 2020
Merged

Conversation

thumbnail
Copy link
Member

@thumbnail thumbnail commented Oct 1, 2020

Brief

Sometimes stacktraces are 'lost' by means of an eager or opaque capture of exceptions. While this is an issue for the consuming application, seeing check failed [...]-errors without a stacktrace can be frustrating and hard to track down.

By setting nedap.utils.spec.print-stack-frames to a positive integer, the defined amount of frames will be printed.

Locally this has been tested for a couple of weeks.

  • replace dynvar with system property.
  • add details in README.md

QA plan

  1. lein repl + refresh
  2. assert (System/getProperty "nedap.utils.spec.print-stack-frames") is 0 or nil
  3. (unit.nedap.utils.spec.api/speced-f 42 :hoi)
  • assert failure + exception is returned, but not frames are printed
  1. (System/setProperty "nedap.utils.spec.print-stack-frames" "99")
  2. (unit.nedap.utils.spec.api/speced-f 42 :hoi)
  • assert failure + exception is returned and frames are printed

Author checklist

  • I have QAed the functionality
  • The PR has a reasonably reviewable size and a meaningful commit history
  • I have run the branch formatter and observed no new/significative warnings
  • The build passes
  • I have self-reviewed the PR prior to assignment
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)
      • ⚠️ this is a clojure only feature for now.

Reviewer checklist

  • I have checked out this branch and reviewed it locally, running it
  • I have QAed the functionality
  • I have reviewed the PR
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)

@thumbnail thumbnail requested a review from a team October 1, 2020 06:05
src/nedap/utils/spec/impl/check.cljc Outdated Show resolved Hide resolved
src/nedap/utils/spec/impl/check.cljc Outdated Show resolved Hide resolved
@thumbnail thumbnail requested a review from a team October 2, 2020 17:49
@thumbnail
Copy link
Member Author

There's no clojurescript compatibility; because clojurescript stacktraces are either missing (?) or not available in the repl i tried ((cljs.repl/repl (cljs.repl.browser/browser-env))).

I think this is RTM imo.

@thumbnail thumbnail changed the title *print-stack-frames* option nedap.utils.spec.print-stack-frames option Oct 5, 2020
@thumbnail thumbnail merged commit cb1cf36 into master Oct 6, 2020
@thumbnail thumbnail deleted the print-stackframes branch October 6, 2020 19:26
@thumbnail thumbnail mentioned this pull request Oct 6, 2020
7 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 this pull request may close these issues.

3 participants