Skip to content

Commit a5bec74

Browse files
committed
Enable verbose debug logging during testing.
And be sure to save the log when testing on CircleCI.
1 parent 401dc16 commit a5bec74

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

.gitignore

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

project.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
[org.clojure/tools.logging "0.3.1"]
1010
[net.n01se/clojure-jna "1.0.0"]
1111
[robert/hooke "1.3.0"]]
12-
:profiles {:dev {:plugins [[lein-codox "0.9.1"]]}}
12+
:profiles {:dev {:plugins [[lein-codox "0.9.1"]]}
13+
:test {:jvm-opts ["-Djava.util.logging.config.file=test/logging.properties"]}}
1314
:deploy-repositories ^:replace [["clojars" {:url "https://clojars.org/repo"
1415
:username [:gpg :env/clojars_username]
1516
:password [:gpg :env/clojars_password]

release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ build_jars() {
8080

8181
save_artifacts() {
8282
if [ -n "${CIRCLE_ARTIFACTS:-}" ]; then
83+
echo "Saving debug log..."
84+
cp test/debug.log "${CIRCLE_ARTIFACTS}"
8385
echo "Copying JARs to CircleCI artifacts..."
8486
find . -name '*.jar' -exec cp {} "${CIRCLE_ARTIFACTS}" \;
8587
fi

test/clj_libssh2/test_utils.clj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
(:require [clojure.java.shell :as sh]
33
[clojure.string :as str]
44
[clojure.test :as test]
5-
[net.n01se.clojure-jna :as jna]))
5+
[net.n01se.clojure-jna :as jna]
6+
[clj-libssh2.logging :as logging]))
67

78
(def ssh-host "127.0.0.1")
89
(def ssh-port 2222)
@@ -50,6 +51,13 @@
5051
(f)
5152
(teardown))
5253

54+
(defn with-really-verbose-logging
55+
[f]
56+
(logging/init)
57+
(f))
58+
5359
(defn fixtures
5460
[]
55-
(test/use-fixtures :once with-sandbox-sshd))
61+
(test/use-fixtures :once (test/join-fixtures
62+
[with-sandbox-sshd
63+
with-really-verbose-logging])))

test/logging.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
handlers=java.util.logging.FileHandler
2+
.level=ALL
3+
4+
java.util.logging.SimpleFormatter.format=[%1$tF %1$tT %1$tz] %4$s: %5$s%6$s%n
5+
6+
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
7+
java.util.logging.FileHandler.level=ALL
8+
java.util.logging.FileHandler.pattern=test/debug.log

0 commit comments

Comments
 (0)