Skip to content

Commit 1e237db

Browse files
authored
lib tests: bump zprint to v1.3.0 (#383)
One failing zprint v1.3.0 test skipped. Failure is environmental and not due to rewrite-clj. See: kkinnear/zprint#355 Did some review/housekeeping for zprint test setup.
1 parent 078d8c7 commit 1e237db

File tree

1 file changed

+13
-29
lines changed

1 file changed

+13
-29
lines changed

script/test_libs.clj

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -235,38 +235,22 @@
235235
;;
236236

237237
(defn- zprint-patch [{:keys [home-dir] :as lib}]
238-
;; zprint has a project.clj and a deps.edn, patch 'em both
238+
;; zprint uses both deps.edn and project.clj, patch them both
239239
(deps-edn-v1-patch lib)
240240
(project-clj-v1-patch lib)
241-
(status/line :detail "v1.4.1 fixup - can delete for subsequent versions")
242-
(let [p (str (fs/file home-dir "project.clj"))]
243-
(-> p
244-
slurp
245-
(string/replace #"\[lein-zprint \"1.2.4\"\]"
246-
"[lein-zprint \"1.2.4.1\"]")
247-
(->> (spit p))))
248-
;; zprint 1.2.9 has a single failing test for https://github.com/clj-commons/rewrite-clj/pull/306
249-
;; Have raised this with over at zprint https://github.com/kkinnear/zprint/issues/333
250-
;; and have agreement that it is a zprint issue.
251-
;; Disable the failing test which starts on line 2538
252-
(status/line :detail "Patching for failing test in v1.2.9")
253-
(let [p (str (fs/file home-dir "test/zprint/guide_test.cljc"))
241+
;; zprint 1.3.0 has a single failing test (at least on linux).
242+
;; See https://github.com/kkinnear/zprint/issues/355
243+
;; Disable the failing test which starts on line 211
244+
(status/line :detail "Patching for failing test in v1.3.0")
245+
(let [p (str (fs/file home-dir "test/zprint/main_test.cljc"))
254246
lines (-> p slurp string/split-lines)
255-
new-lines (update lines 2537 #(str "#_" %))]
247+
new-lines (update lines 210 #(str "#_" %))]
256248
(->> (string/join "\n" new-lines)
257249
(spit p))))
258250

259251
(defn- zprint-prep [{:keys [home-dir]}]
260252
(status/line :detail "=> Building uberjar for uberjar tests")
261-
(shcmd {:dir home-dir} "lein uberjar")
262-
;; not sure if this is still necessary...
263-
(status/line :detail "=> Installing zprint locally for ClojureScript tests")
264-
(shcmd {:dir home-dir} "lein install"))
265-
266-
(defn- zprint-cleanup [_lib]
267-
(status/line :detail "=> Deleting jar installed to local maven repo for tests")
268-
;; currently an over-clobber but official zprint libs will re-install as needed
269-
(fs/delete-tree (fs/file (fs/home) ".m2/repository/zprint")))
253+
(shcmd {:dir home-dir} "lein uberjar"))
270254

271255
;;
272256
;; lib defs
@@ -465,22 +449,22 @@
465449
:show-deps-fn lein-deps-tree
466450
:test-cmds ["lein test"]}
467451
{:name "zprint"
468-
:version "1.2.9"
469-
:note "1) planck cljs tests disabled for now: https://github.com/planck-repl/planck/issues/1088 2) failing v1.2.9 test disabled"
452+
:version "1.3.0"
453+
:note "1) planck cljs tests disabled for now: https://github.com/planck-repl/planck/issues/1088"
470454
:platforms [:clj :cljs]
471455
:github-release {:repo "kkinnear/zprint"}
472456
:patch-fn zprint-patch
473457
:prep-fn zprint-prep
474458
:show-deps-fn (fn [lib]
475-
(status/line :detail "=> Deps for Clojure run:")
459+
(status/line :detail "=> project.clj:")
476460
(lein-deps-tree lib)
477-
(status/line :detail "=> Deps Clojurescript run:")
461+
(status/line :detail "=> deps.edn:")
478462
(cli-deps-tree lib))
479463
:test-cmds ["clojure -M:cljtest"
480464
;; disable zprint cljs tests for now, see https://github.com/planck-repl/planck/issues/1088
481465
#_"clojure -M:cljs-runner"]
482466
;; :requires ["planck"] ;; re-enable when cljs tests are re-enabled
483-
:cleanup-fn zprint-cleanup}])
467+
}])
484468

485469
(defn- header [text]
486470
(let [dashes (apply str (repeat 80 "-"))]

0 commit comments

Comments
 (0)