File tree 2 files changed +28
-5
lines changed
src/practitest_firecracker 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 1
1
(ns practitest-firecracker.const )
2
2
3
- (def ^:const fc-version " 2.1.2 " )
3
+ (def ^:const fc-version " 2.1.4 " )
4
4
5
5
(def ^:const testset-instances-uri " /projects/%d/instances.json" )
6
6
(def ^:const test-uri " /projects/%d/tests/%d.json" )
Original file line number Diff line number Diff line change 4
4
[clojure.string :as str]
5
5
[clojure.xml :as xml]
6
6
[clojure.zip :as zip])
7
- (:import (java.text NumberFormat)
8
- (java.io ByteArrayInputStream)))
7
+ (:import
8
+ (java.io ByteArrayInputStream)
9
+ (java.text NumberFormat)))
9
10
10
11
(defn round
11
12
[x & {p :precision }]
51
52
{:tag :testsuites :content (flatten-testsuite root)}
52
53
root))
53
54
55
+ (defn normalize-attribute [value]
56
+ (when value
57
+ (str/replace value " /" " ." )))
58
+
59
+ (defn normalize-attributes
60
+ " Sometimes `classname` and `name` contain '/', we need to replace it with '.'"
61
+ [element]
62
+ (if (map? element)
63
+ (if-let [_attrs (:attrs element)]
64
+ (-> element
65
+ (update-in [:attrs :name ] normalize-attribute)
66
+ (update-in [:attrs :classname ] normalize-attribute)
67
+ (update :content #(map normalize-attributes %)))
68
+ (update element :content #(map normalize-attributes %)))
69
+ element))
70
+
54
71
(defn zip-str [s]
55
72
(zip/xml-zip
56
- (preprocess-xunit
57
- (xml/parse (ByteArrayInputStream. (.getBytes s " UTF-8" ))))))
73
+ (normalize-attributes
74
+ (preprocess-xunit
75
+ (xml/parse (ByteArrayInputStream. (.getBytes s " UTF-8" )))))))
58
76
59
77
(defn filter-tags [tag-key xml-content]
60
78
(let [filter-result (filter #(= (:tag %) tag-key) xml-content)]
243
261
(preprocess-xunit
244
262
(xml/parse (ByteArrayInputStream. (.getBytes s " UTF-8" ))))))
245
263
264
+ (let [s (slurp " test-data/pb/report.xml" )]
265
+ (normalize-attributes
266
+ (preprocess-xunit
267
+ (xml/parse (ByteArrayInputStream. (.getBytes s " UTF-8" ))))))
268
+
246
269
)
You can’t perform that action at this time.
0 commit comments