Fork me on GitHub
#cloverage
<
2016-08-13
>
fossifoo09:08:13

wow, lvh, this surely is a spree you sent me on

fossifoo09:08:32

write a test he said. it's going to be fun he said XD

fossifoo09:08:16

tbh, this code is a bit, um, side effect heavy all over the place

fossifoo09:08:43

i'm not sure you are going to like my test code much... it's not pretty

lvh12:08:19

sorry 😄

lvh12:08:13

I mean, I’ll let you get away with it if you’d like to call it quits — it’ll be a lot easier to test that code if we get to have dependencies — at least the code around it will have more facilities for testing

lvh12:08:44

@fossifoo: I’d expect it to be not terribly hard with with-out-str though?

lvh12:08:00

or are there side effects I’m forgetting about

fossifoo15:08:09

most of the stuff is wrapped in a with-out-writer macro that you can't with-redef-fn in a test

fossifoo15:08:23

so yeah, i had to split my code in two parts. so far, so fine

fossifoo15:08:51

then you need forms to test with and i thought i'd use the content of the sample.clj

fossifoo15:08:33

then you need to read that back in as testdata and the functions in source.clj almost do what you want, but not quite

fossifoo15:08:16

and after all that i discovered that the gather-stats form reads all the source files again during reporting

fossifoo15:08:47

which is probably not what we want in the long run either, because it effectively prohibits output plugins

fossifoo15:08:26

i guess i always overengineer a bit too 😉

jaceklach15:08:47

the reason we reread the source files is i believe because it was the simplest way to get the formatting right

fossifoo15:08:51

but hey, what's free time good for, if you aren't properly yakshaving

fossifoo15:08:38

yeah, now that i look at it, i think it's more of an "interface" abstraction thing

fossifoo15:08:32

if the whole gather-stats would be in it's own package or such, reports would be "out" only

fossifoo15:08:40

and running/coverage "in"

fossifoo15:08:04

but conceptionally i guess that "gather-stats" belongs more to the reporting phase

fossifoo15:08:13

so mainly, i was a bit confused 😉

jaceklach15:08:57

oh ye that doesn't really belong in report.clj i guess.

jaceklach15:08:08

i forgot that was a thing 🙂

fossifoo15:08:16

i would propose splitting "coverage.clj" anyway

fossifoo15:08:32

because it's hard to deal with from the boot task for example

fossifoo15:08:45

having to construct string parameters and such XD

jaceklach15:08:55

no argument there, it's not nice

fossifoo15:08:06

but, yeah, first things first

jaceklach15:08:31

or at least exctract the body of -main so that parsing options is separate from actually acting on them 😛

fossifoo20:08:28

i've got the testing in. resubmitting PR

fossifoo20:08:42

also submitted a PR for the boot task, even though it's still a bit rough. would be nice if people comment especially if anybody has more than 3 days of boot experience 😄