testing

Testing tools, testing philosophy & methodology...
avi 2018-12-19T21:37:48.002800Z

👋 Hi all, I’ve forked eftest to attempt to add a feature, but I’m having trouble getting eftest’s tests to pass. And I mean, on current master. I don’t see any guidance in the README on running eftest’s tests, so given that I’m pretty rusty with Leiningen I wonder whether I’m missing something… is it generally sufficent to just clone a repo, cd to wherever a project.clj file is, and then run lein test ?

avi 2018-12-19T21:38:59.003600Z

The specific Leiningen project I’m testing is here: https://github.com/weavejester/eftest/tree/master/eftest

seancorfield 2018-12-19T22:36:49.004100Z

@aviflax This failure

FAIL in (file-and-line-in-pretty-fail-report) (report_test.clj:42)
expected: (= (str "\nFAIL in eftest.report-test/file-and-line-in-pretty-fail-report" " (report_test.clj:999)\n" "foo\n" "expected: " pretty-nil "\n  actual: " pretty-nil "\n") result)
  actual: (not (= "\nFAIL in eftest.report-test/file-and-line-in-pretty-fail-report (report_test.clj:999)\nfoo\nexpected: nil\n  actual: nil\n" "\nFAIL in  (report_test.clj:999)\nfoo\nexpected: nil\n  actual: nil\n"))

seancorfield 2018-12-19T22:37:05.004500Z

(the other two seem to be "expected" failures, based on the test names)

avi 2018-12-19T22:37:21.004700Z

Yup that one

seancorfield 2018-12-19T22:50:36.005200Z

Looks like it's failing to bind report/*testing-path*

seancorfield 2018-12-19T22:50:56.005600Z

I added that to the binding call in that test and it passes.

seancorfield 2018-12-19T22:53:01.006700Z

Specifically, I added

(def my-ns *ns*)
just above that test (to capture the compilation namespace) and
report/*testing-path* [my-ns #'file-and-line-in-pretty-fail-report]
into the binding call.

avi 2018-12-19T22:58:34.007400Z

Excellent, thanks! I’ll open a PR with that fix.

avi 2018-12-19T23:28:24.007600Z

https://github.com/weavejester/eftest/pull/62