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

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

Open
tgk opened this issue Jan 5, 2024 · 6 comments
Open

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

tgk opened this issue Jan 5, 2024 · 6 comments

Comments

@tgk
Copy link

tgk commented Jan 5, 2024

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
Copy link
Member

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
Copy link
Author

tgk commented Feb 2, 2024

@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
Copy link
Author

tgk commented Feb 2, 2024

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

@tgk
Copy link
Author

tgk commented Feb 2, 2024

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

@tgk
Copy link
Author

tgk commented Feb 2, 2024

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

@tgk tgk closed this as completed Feb 2, 2024
@jpmonettas
Copy link
Member

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!

@jpmonettas jpmonettas reopened this Feb 2, 2024
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

No branches or pull requests

2 participants