Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Include more detail in Junit failure messages #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject circleci/circleci.test "0.4.2"
(defproject circleci/circleci.test "0.4.2-SNAPSHOT"
:description "clojure.test compatible test-runner"
:url "https://github.com/circleci/circleci.test"
:license {:name "Eclipse Public License"
Expand Down
14 changes: 13 additions & 1 deletion src/circleci/test/report/junit.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"Junit reporter for circleci.test"
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[clojure.string :as string]
[clojure.test :as test]
[circleci.test.report :as report])
(:import clojure.data.xml.Element))

Expand Down Expand Up @@ -71,7 +73,17 @@
(defn- failure-xml
[m]
(xml/sexp-as-element [:failure {:type "assertion failure"
:message (format "expected: %s. actual: %s" (:expected m) (:actual m))} ""]))
:message
(string/join \newline
(filter
some?
[(format "FAIL in %s" (report/testing-vars-str m))
(when (seq test/*testing-contexts*)
(report/testing-contexts-str))
(when-let [message (:message m)]
message)
(format "expected: %s" (pr-str (:expected m)))
(format " actual: %s" (pr-str (:actual m)))]))}]))

(defn- error-xml
[m]
Expand Down