This is maddening
This commit is contained in:
parent
0976004efe
commit
c96f2b4d07
2 changed files with 23 additions and 15 deletions
2
deps.edn
2
deps.edn
|
|
@ -104,7 +104,7 @@
|
||||||
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}
|
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}
|
||||||
reifyhealth/specmonstah {:git/url "https://github.com/reifyhealth/specmonstah", :sha "a2b357009a3aa99a0c2d2361f3bbcd0b0e36505e"}
|
reifyhealth/specmonstah {:git/url "https://github.com/reifyhealth/specmonstah", :sha "a2b357009a3aa99a0c2d2361f3bbcd0b0e36505e"}
|
||||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
orchestra/orchestra {:local/root "/tmp/orchestra"} #_{:mvn/version "2021.01.01-1"}
|
||||||
expound/expound {:mvn/version "0.8.10"}
|
expound/expound {:mvn/version "0.8.10"}
|
||||||
integrant/integrant {:mvn/version "0.8.0"}
|
integrant/integrant {:mvn/version "0.8.0"}
|
||||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,24 @@
|
||||||
(ns babashka.run-all-libtests
|
(ns babashka.run-all-libtests
|
||||||
(:require [babashka.classpath :as cp :refer [add-classpath]]
|
(:require
|
||||||
[babashka.core :refer [windows?]]
|
[babashka.classpath :as cp :refer [add-classpath]]
|
||||||
[babashka.fs :as fs]
|
[babashka.core :refer [windows?]]
|
||||||
[clojure.edn :as edn]
|
[babashka.fs :as fs]
|
||||||
[clojure.java.io :as io]
|
[clojure.edn :as edn]
|
||||||
[clojure.test :as t :refer [*report-counters*]]
|
[clojure.java.io :as io]
|
||||||
[clojure.string :as str]))
|
[clojure.spec.test.alpha :as st]
|
||||||
|
[clojure.string :as str]
|
||||||
|
[clojure.test :as t :refer [*report-counters*]]
|
||||||
|
[orchestra.spec.test :as ot]))
|
||||||
|
|
||||||
(defmethod clojure.test/report :begin-test-var [m]
|
#_(defmethod t/report :begin-test-var [m]
|
||||||
(println "Running" (subs (str (-> m :var str)) 2)))
|
(println "Running" (subs (str (-> m :var str)) 2)))
|
||||||
|
|
||||||
(defmethod clojure.test/report :end-test-var [_m]
|
#_:clj-kondo/ignore
|
||||||
|
(def orig-spec-checking-fn @#'clojure.spec.test.alpha/spec-checking-fn)
|
||||||
|
|
||||||
|
(alter-var-root #'st/spec-checking-fn (constantly orig-spec-checking-fn))
|
||||||
|
|
||||||
|
(defmethod t/report :end-test-var [_m]
|
||||||
(when-let [rc *report-counters*]
|
(when-let [rc *report-counters*]
|
||||||
(let [{:keys [:fail :error]} @rc]
|
(let [{:keys [:fail :error]} @rc]
|
||||||
(when (and (= "true" (System/getenv "BABASHKA_FAIL_FAST"))
|
(when (and (= "true" (System/getenv "BABASHKA_FAIL_FAST"))
|
||||||
|
|
@ -38,11 +46,11 @@
|
||||||
(defn test-namespaces [& namespaces]
|
(defn test-namespaces [& namespaces]
|
||||||
(let [namespaces (seq (filter test-namespace? namespaces))]
|
(let [namespaces (seq (filter test-namespace? namespaces))]
|
||||||
(when (seq namespaces)
|
(when (seq namespaces)
|
||||||
(let [no-orch-namespaces (remove #(str/starts-with? (str %) "orchestra") namespaces)
|
(let [namespaces namespaces]
|
||||||
;; somehow orchestra screws up other tests, so we run that last
|
|
||||||
orch-namespaces (filter #(str/starts-with? (str %) "orchestra") namespaces)
|
|
||||||
namespaces (concat no-orch-namespaces orch-namespaces)]
|
|
||||||
(doseq [n namespaces]
|
(doseq [n namespaces]
|
||||||
|
(if (str/starts-with? (str n) "orchestra")
|
||||||
|
(alter-var-root #'st/spec-checking-fn (constantly ot/spec-checking-fn))
|
||||||
|
(alter-var-root #'st/spec-checking-fn (constantly orig-spec-checking-fn)))
|
||||||
(require n)
|
(require n)
|
||||||
(filter-vars! (find-ns n) #(-> % meta ((some-fn :skip-bb
|
(filter-vars! (find-ns n) #(-> % meta ((some-fn :skip-bb
|
||||||
:test-check-slow)) not))
|
:test-check-slow)) not))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue