From aaf43be5f3b0ddbfe3f252353f197648da7f0828 Mon Sep 17 00:00:00 2001 From: Conor McDermottroe Date: Mon, 15 Feb 2016 01:32:15 +0000 Subject: [PATCH 1/2] Make the tests output JUnit XML Copy them into the right place for CircleCI to parse them. --- .gitignore | 1 + circle.yml | 7 +++++++ project.clj | 3 ++- test/clj_libssh2/test_utils.clj | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e1b0d80..3a0bb2a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ pom.xml.asc .hg/ doc/api test/debug.log +test/junit.xml diff --git a/circle.yml b/circle.yml index a7feff9..5704af2 100644 --- a/circle.yml +++ b/circle.yml @@ -2,6 +2,13 @@ machine: java: version: oraclejdk8 +test: + post: + - mkdir -p ${CIRCLE_TEST_REPORTS}/lein-test: + parallel: true + - cp test/junit.xml ${CIRCLE_TEST_REPORTS}/lein-test/${CIRCLE_NODE_INDEX}.xml: + parallel: true + deployment: all: branch: /.*/ diff --git a/project.clj b/project.clj index 0fdec46..821f794 100644 --- a/project.clj +++ b/project.clj @@ -11,7 +11,8 @@ [net.n01se/clojure-jna "1.0.0"] [robert/hooke "1.3.0"]] :profiles {:dev {:plugins [[lein-codox "0.9.1"]]} - :test {:jvm-opts ["-Djava.util.logging.config.file=test/logging.properties"]}} + :test {:dependencies [[clojure-test-junit-output "0.1.3"]] + :jvm-opts ["-Djava.util.logging.config.file=test/logging.properties"]}} :deploy-repositories ^:replace [["clojars" {:url "https://clojars.org/repo" :username [:gpg :env/clojars_username] :password [:gpg :env/clojars_password] diff --git a/test/clj_libssh2/test_utils.clj b/test/clj_libssh2/test_utils.clj index b2775e7..893f03b 100644 --- a/test/clj_libssh2/test_utils.clj +++ b/test/clj_libssh2/test_utils.clj @@ -2,6 +2,7 @@ (:require [clojure.java.shell :as sh] [clojure.string :as str] [clojure.test :as test] + [clojure-test-junit-output.core :refer [with-junit-output]] [net.n01se.clojure-jna :as jna] [clj-libssh2.logging :as logging]) (:import [java.io File])) @@ -60,7 +61,8 @@ (defn fixtures [] (test/use-fixtures :once (test/join-fixtures - [with-sandbox-sshd + [(with-junit-output "test/junit.xml") + with-sandbox-sshd with-really-verbose-logging]))) (defmacro with-temp-file From b28297fe3fdbc07f89f4d20e00b93e3b4b045227 Mon Sep 17 00:00:00 2001 From: Conor McDermottroe Date: Mon, 15 Feb 2016 23:12:59 +0000 Subject: [PATCH 2/2] Make the ssh tail test block for a shorter amount of time. --- test/clj_libssh2/test_ssh.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/clj_libssh2/test_ssh.clj b/test/clj_libssh2/test_ssh.clj index 1cb2553..6b632e3 100644 --- a/test/clj_libssh2/test_ssh.clj +++ b/test/clj_libssh2/test_ssh.clj @@ -96,7 +96,8 @@ (swap! output conj (String. b off len)))) run-exec (future (try - (ssh/exec {:port 2222 + (ssh/exec {:blocking-timeout 5000 + :port 2222 :read-timeout 5000} (str "tail -F " tempfile) :out streaming-reader)