flow-storm / clofidence

Bolster your Clojure test suite confidence
The Unlicense
46 stars 2 forks source link

Wrong number of args (0) passed to: clojure.core/max #3

Open tgk opened 10 months ago

tgk commented 10 months ago

I attempted to use clofidence to generate a test report for our internal API using the README as a guide. After using the configuration from the README and running $ clj -X:test:clofidence the test suite runs just fine but when it comes to generating the report it errs:

{:clojure.main/message
 "Execution error (ArityException) at clofidence.report-renderer/render-report-overview (report_renderer.clj:38).\nWrong number of args (0) passed to: clojure.core/max\n",
 :clojure.main/triage
 {:clojure.error/class clojure.lang.ArityException,
  :clojure.error/line 38,
  :clojure.error/cause
  "Wrong number of args (0) passed to: clojure.core/max",
  :clojure.error/symbol
  clofidence.report-renderer/render-report-overview,
  :clojure.error/source "report_renderer.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.ArityException,
    :message "Wrong number of args (0) passed to: clojure.core/max",
    :at [clojure.lang.AFn throwArity "AFn.java" 429]}],
  :trace
  [[clojure.lang.AFn throwArity "AFn.java" 429]
   [clojure.lang.RestFn invoke "RestFn.java" 399]
   [clojure.lang.AFn applyToHelper "AFn.java" 152]
   [clojure.lang.RestFn applyTo "RestFn.java" 132]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.core$apply invoke "core.clj" 662]
   [clofidence.report_renderer$render_report_overview
    invokeStatic
    "report_renderer.clj"
    38]
   [clofidence.report_renderer$render_report_overview
    invoke
    "report_renderer.clj"
    33]
   [clofidence.report_renderer$render_report_to_string
    invokeStatic
    "report_renderer.clj"
    79]
   [clofidence.report_renderer$render_report_to_string
    invoke
    "report_renderer.clj"
    59]
   [clofidence.main$run invokeStatic "main.clj" 177]
   [clofidence.main$run invoke "main.clj" 153]
   [clojure.lang.Var invoke "Var.java" 384]
   [clojure.run.exec$exec invokeStatic "exec.clj" 89]
   [clojure.run.exec$exec invoke "exec.clj" 78]
   [clojure.run.exec$_main$fn__219 invoke "exec.clj" 216]
   [clojure.run.exec$_main invokeStatic "exec.clj" 212]
   [clojure.run.exec$_main doInvoke "exec.clj" 180]
   [clojure.lang.RestFn invoke "RestFn.java" 397]
   [clojure.lang.AFn applyToHelper "AFn.java" 152]
   [clojure.lang.RestFn applyTo "RestFn.java" 132]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.main$main_opt invokeStatic "main.clj" 523]
   [clojure.main$main_opt invoke "main.clj" 519]
   [clojure.main$main invokeStatic "main.clj" 674]
   [clojure.main$main doInvoke "main.clj" 626]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "Wrong number of args (0) passed to: clojure.core/max"}}
jpmonettas commented 10 months ago

Can you share your deps.edn alias with the config? I have seen that once when nothing gets instrumented because some issue in the instrumentation config.

tgk commented 9 months ago

@jpmonettas of course! Sorry for the delay:

:clofidence
           {:classpath-overrides {org.clojure/clojure nil}
            :extra-deps {com.github.flow-storm/clojure    {:mvn/version "LATEST"} ; >= 1.11.1-15
                         com.github.flow-storm/clofidence {:mvn/version "LATEST"}}
            :exec-fn clofidence.main/run
            :exec-args {:report-name  "API"
                        :test-fn      cognitect.test-runner.api/test
                        :test-fn-args [{}]}
            :jvm-opts
            ["-Dclojure.storm.instrumentOnlyPrefixes=my-app"
             "-Dclojure.storm.instrumentSkipPrefixes=my-app.unwanted-ns1,my-app.unwanted-ns2"
             "-Dclojure.storm.instrumentSkipRegex=.*test.*"
             "-Duser.timezone=UTC"
             "-XX:-OmitStackTraceInFastThrow"]}
tgk commented 9 months ago

Seeing this and your comment made me realize it's probably the "-XX:-OmitStackTraceInFastThrow" :thinking: Thanks!

tgk commented 9 months ago

Ah, also I just copied the pattern for what should be instrumented. Sorry, obviously that's the problem.

tgk commented 9 months ago

That solved it! Sorry for the noise. It might be nice to have better error reporting for my (admittedly stupid) mistake.

jpmonettas commented 9 months ago

Great to hear it is solved! Yeah I agree that error is very confusing for a common mistake like wrong instrumentation. I'll leave this open and something for it!