Clojure test metadata collection


#1

Hi folks

On this page https://circleci.com/docs/test-metadata you could add a link to https://github.com/ruedigergad/test2junit for Clojure applications.


#2

I want to try this out by myself before documenting. Do you have a sample project where you are using test2junit in CircleCI? I can create but it would be awesome if you’ve already done this.


#3

I don’t have an open source project for this, but the relevant lines in your project.clj are:

:test2junit-output-dir ~(or (System/getenv "CIRCLE_TEST_REPORTS") "target/test2junit")
:plugins [[test2junit "1.1.2"]]

(only the getenv part is necessary, but I wanted to keep the test output out of the way when running locally).

then run

lein test2junit

in my circle.yml

test:
  override:
    - lein test2junit

the only issue with this is that test2junit output goes into a hardcoded folder xml which makes Circle think that my test suite is called xml. I’m thinking about opening a PR to allow naming of that folder for Circle CI use.


#4

@danielcompton I created sample project to demonstrate the metadata collection with test2junit. I also added a pointer to our https://circleci.com/docs/test-metadata so should be shipped soon.

Thank you for bringing this up!


#5