Skip to content

Commit aaf43be

Browse files
committed
Make the tests output JUnit XML
Copy them into the right place for CircleCI to parse them.
1 parent 3ae9101 commit aaf43be

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ pom.xml.asc
1111
.hg/
1212
doc/api
1313
test/debug.log
14+
test/junit.xml

circle.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ machine:
22
java:
33
version: oraclejdk8
44

5+
test:
6+
post:
7+
- mkdir -p ${CIRCLE_TEST_REPORTS}/lein-test:
8+
parallel: true
9+
- cp test/junit.xml ${CIRCLE_TEST_REPORTS}/lein-test/${CIRCLE_NODE_INDEX}.xml:
10+
parallel: true
11+
512
deployment:
613
all:
714
branch: /.*/

project.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
[net.n01se/clojure-jna "1.0.0"]
1212
[robert/hooke "1.3.0"]]
1313
:profiles {:dev {:plugins [[lein-codox "0.9.1"]]}
14-
:test {:jvm-opts ["-Djava.util.logging.config.file=test/logging.properties"]}}
14+
:test {:dependencies [[clojure-test-junit-output "0.1.3"]]
15+
:jvm-opts ["-Djava.util.logging.config.file=test/logging.properties"]}}
1516
:deploy-repositories ^:replace [["clojars" {:url "https://clojars.org/repo"
1617
:username [:gpg :env/clojars_username]
1718
:password [:gpg :env/clojars_password]

test/clj_libssh2/test_utils.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(:require [clojure.java.shell :as sh]
33
[clojure.string :as str]
44
[clojure.test :as test]
5+
[clojure-test-junit-output.core :refer [with-junit-output]]
56
[net.n01se.clojure-jna :as jna]
67
[clj-libssh2.logging :as logging])
78
(:import [java.io File]))
@@ -60,7 +61,8 @@
6061
(defn fixtures
6162
[]
6263
(test/use-fixtures :once (test/join-fixtures
63-
[with-sandbox-sshd
64+
[(with-junit-output "test/junit.xml")
65+
with-sandbox-sshd
6466
with-really-verbose-logging])))
6567

6668
(defmacro with-temp-file

0 commit comments

Comments
 (0)