weissjeffm / test.tree.runner

A UI for test.tree
0 stars 1 forks source link

Allow loading of results directly from URL #24

Open weissjeffm opened 11 years ago

weissjeffm commented 11 years ago

Add File -> Open Results URL

This will save us from having to download the file ourselves and then use java's crappy file finder to locate and open it. Instead just copy/paste the URL.

gstoeckel commented 11 years ago

Have implemented the feature, but I've been struggling with the data contained in the report.clj files. Calling read-string on the data results in "Unrecognized form" exception. So data is detected as malformed for some reason. Looking at source for read-string suggests an unescaped "<", but I've been unable to find it in the data.

weissjeffm commented 11 years ago

Maybe binary search for the offending section by catting x characters into a new file. You should get something like 'unmatched delimiter' if the bad data isn't in the partial file.

weissjeffm commented 11 years ago

Actually should be pretty easy to binary search programatically at the repl.

gstoeckel commented 11 years ago

So I think the problem is where I had pointed to previously: at the end of the first line there is an AssertionError that has many unescaped quotes within it. Seems I may need to override pprint for AssertionError?

gstoeckel commented 11 years ago

Yup, that's the problem. Just created an AssertionError at the REPL with quotes in the assertion message, and they are printed unescaped.

weissjeffm commented 11 years ago

You know, I think I saw a change in my local git repo that I hadn't committed that would have fixed this. Will check that out tomorrow.

weissjeffm commented 11 years ago

I just had a chat with the nice folks on #clojure about this. They suggested that we shouldn't be overriding print-method for types we don't "own", like Object. I told them we didn't really have any choice if we wanted to pretty-print something because pprint uses print-method. Then I realized, we stopped using pprint, didn't we? So if I'm not mistaken we're free of that restriction. If so I think I know the fix for your problem.

weissjeffm commented 11 years ago

Hm, I think the testng report xml files still use pprint, and would be a mess to read if they didn't. And if we don't override the default dispatch, it confuses the syntax highlighter. So I guess I still don't know any "good" solution, however the irc channel suggested a hack to use pr-str to escape the string, and that might be good enough.