Fork me on GitHub
#expound
<
2019-05-09
>
Alex Whitt14:05:41

Hi again, I'm really loving expound. My current issue is that, while it's printing the function arguments beautifully, it doesn't tell me what function the call came from. I just get:

Execution error - invalid arguments to orchestra.spec.test/spec-checking-fn$conform! at (test.cljc:115).
type.clj:175

-- Spec failed --------------------

Function arguments
...

Alex Whitt14:05:36

I do get <file>.clj:<line> but I have multiple files named "type.clj" in my project.

bbrinck14:05:11

I agree, this is confusing! Unfortunately, this is an issue with spec :(. I’ve created a JIRA but it’s not fixed (actually, to be more precise, it’s solved in some cases but not others, and I want to present a consistent UI)

Alex Whitt14:05:42

Ah, so spec itself doesn't give you the full path to the function call??

bbrinck14:05:29

Correct. I think spec now includes the name of the function, which would be nice to include (although it is shown above, just in a non-ideal location), but it doesn’t yet do the same thing for macros, which makes it hard to present something consistent

Alex Whitt14:05:17

In my example above, it's not actually printing the spec'd function, but rather the caller of the function (I think).

bbrinck14:05:28

I think in this case it’s easiest to grep for ‘conform!’ and see which file contains that call on line 115 but I agree it’s not ideal

bbrinck15:05:33

Hm, I would expect a call to ‘conform’ on line 115. If that’s not the case, I think that’s a bug, although I suspect a bug somewhere else besides expound ( it’s not involved in printing the “execution error” line)

Alex Whitt15:05:59

Yeah I have no idea what "test.cljc" it's talking about, definitely not my code.

bbrinck15:05:22

That appears to be a function in orchestra. the line numbers have changed (since github is showing a different version than what’s on your machine), but likely something like https://github.com/jeaye/orchestra/blob/4e7fd20ab6596528560c730d1425a77edc1ea2e9/src/clj/orchestra/spec/test.cljc#L124-L131

bbrinck15:05:11

If it were me, I’d look at disabling orchestra for now, see if the problem reproduces

bbrinck15:05:00

Ah, good find!

bbrinck15:05:49

So maybe try disabling orchestra and using normal instrumentation until you find the part of your code that is causing issues. I think that’s a minor change to wherever you call instrument

bbrinck15:05:01

hope that helps!

Alex Whitt15:05:34

Yep, that's the ticket. Thank you for your help!