I’m having a problem with Eastwoods tests which I can’t really figure out:
lein test eastwood.test.linters-test
Warning: *var2* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *var2* or change the name
Warning: *var2* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *var2* or change the name. (testcases/f01.clj:152)
cases/testcases/f03.clj:66:5: Reflection warning - call to method browse on java.lang.Object can't be resolved (no such method).
Pretty-printed diffs between actual and expected lint results:
[{{:linter :deprecations,
:msg
"Static method 'public static void <http://org.apache.commons.io|org.apache.commons.io>.IOUtils.closeQuietly(<http://java.io|java.io>.Writer)' is deprecated.",
:file "testcases/f07.clj",
:line 193,
:column 24}
1,
{:linter :deprecations,
:msg
"Static method 'public static void <http://org.apache.commons.io|org.apache.commons.io>.IOUtils.closeQuietly(<http://java.io|java.io>.Writer)' is deprecated.",
:file "testcases/f07.clj",
:line 197,
:column 7}
1}
nil]
lein test :only eastwood.test.linters-test/test1
I can’t really understand why this is failing, but I see that closeQuietly
is called twice in f07.clj
Also, I can’t seem to bisect my way back to a place where this is not failing.
And looking at the commits (and circle-ci’s builds) this doesn’t make sense to me at all.
Looks like perhaps only a difference in line and column numbers?
which could happen if someone edited f07.clj source file
Yeah, but I can’t really see that (nor can I see that the error message is listed as an expected one?)
OK, looking more carefully now, after reproducing locally ...
It looks like both of those warnings are being generated when you run the test, but the expected results contain neither of them.
Agreed
Perhaps a root cause might be that the closeQuietly
method is now annotated as deprecated, but was not when the test was created
But that’s kind of strange isn’t it, as it’s pegged at 2.4?
Oh, wait, maybe something else depends on io-utils has up’ed the version?
doesn’t seem like it.
https://commons.apache.org/proper/commons-io/javadocs/api-2.4/index.html
I don't have any guesses yet, but found this commit that introduced the test in 2015, and it has a fair number of comments about what it was trying to fix: https://github.com/jonase/eastwood/commit/48345f026ace78926eb9d51cc7ffc761b1227b77
closeQuietly
doesn’t seem to be deprecated (from the docs).
which seem to involve using reflection API to get info about some Java methods.
That commit passes 🙂
That sounds like a fairly large number of commits for a bisect process.
I seem to be somewhere interesting now
e9481c83a9b33749b6b87a4c230cd26a57e2d92b passes
Seems like it was introduced in 35cc845a10a8144fc48ca223c222129f16a2e759
OK. I am not intimately familiar with that Leiningen option and what it does.
The funny bit is that removing the :eval-in-leiningen true
bit doesn’t help.
strike that, I was editing the wrong file.
yep, master works without the :eval-in-leiningen true
Aaand, problem solved 🙂
At least understood.
eval-in-leiningen
is for plugins, I think
leiningen-2.9.1 depends on commons-io 2.6 where closeQuietly is deprecated
I guess the reason I added eval-in-leiningen
was to make eastwood lint itself.
maybe you can use a profile
for that?
Don’t know. Will have to investigate tomorrow. For now, downgrading to lein-2.8 works wonders
@andy.fingerhut sorry for the noise. I guess I owe you YAVB.
YAVB? Neither Google nor my memory are helping me there.
Yet Another Virtual Beer 🙂
Just invented that
ah, I accept 🙂