etaoin

igrishaev 2017-10-29T18:05:38.000065Z

@cjsauer I remember, there is a wrong case in readme with postmortem handler. You need to wrap not a fixture, but your test.

igrishaev 2017-10-29T18:05:59.000148Z

@cjsauer I mean, use something like that:

(deftest my-test
  (with-postmortem {...}
    (some code)))

cjsauer 2017-10-29T18:15:15.000064Z

@metametadata makes perfect sense, I'll give that a try. In one of my test cases I was indeed using is. @igrishaev interesting. Is there some workaround for wrapping the whole fixture? I imagine I'd end up wrapping every deftest in a postmortem handler...checking the source of clojure.test, it looks like it's test-var that is swallowing the exception https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj#L707

igrishaev 2017-10-29T18:16:05.000070Z

@cjsauer I created an issue for that in the repo.

igrishaev 2017-10-29T18:16:21.000038Z

Wrapping each tests would be annoying, I know.

cjsauer 2017-10-29T18:16:42.000042Z

I'm happy to help discuss solutions, or even work on a PR

cjsauer 2017-10-29T18:35:05.000070Z

@igrishaev It seems that etaoin mostly relies on exceptions to mean failure, and the lack of exception to mean success. The reason I get this impression is because of functions like has-text?; the assertion is implicit, and so something like is is maybe redundant. Maybe we could rely on clojure.test's runners only, and then use something like test-ns-hook as an entry point. This would allow us full control over exception catching.

igrishaev 2017-10-29T18:42:37.000083Z

@cjsauer has-text? and some other functions that end with question mark usually do not raise an exception but return strict boolean result; of you face an exception when running has-text?, that means wrong function design.

igrishaev 2017-10-29T18:43:44.000016Z

And keep in mind, the library might be used not only for tests but for automation.

cjsauer 2017-10-29T18:46:44.000050Z

@igrishaev ah I see. That actually makes a lot more sense from a composition standpoint.

cjsauer 2017-10-29T18:53:02.000122Z

>in order to catch all test fails you'd need to re-bind clojure.test/report I think this is an interesting solution, and something that with-postmortem could potentially do on-the-fly

cjsauer 2017-10-29T18:54:08.000008Z

Problem is that it makes the assumption that you're using clojure.test

cjsauer 2017-10-29T18:56:18.000110Z

Maybe a with-test-postmortem could be created