Skip to content

Commit 4738c6e

Browse files
committed
remove flaky test
1 parent 4fe9a52 commit 4738c6e

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

test/unit/kaocha/watch_test.clj

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -104,43 +104,6 @@
104104
(spit tmp-file "#kaocha/v1 {:tests [{:id :foo}]}")
105105
(first (w/reload-config {:kaocha/cli-options {:config-file (str tmp-file)}} []))))))
106106

107-
(deftest ^{:min-java-version "1.11"} watch-test
108-
(let [{:keys [config-file test-dir] :as m} (integration/test-dir-setup {})
109-
config (-> (config/load-config config-file)
110-
(assoc-in [:kaocha/cli-options :config-file] (str config-file))
111-
(assoc-in [:kaocha/tests 0 :kaocha/source-paths] [])
112-
(assoc-in [:kaocha/tests 0 :kaocha/test-paths] [(str test-dir)]))
113-
prefix (str (gensym "foo"))
114-
finish? (atom false)
115-
q (w/make-queue)
116-
out-str (promise)
117-
test-file-path (str "test/" prefix "/bar_test.clj")]
118-
(integration/spit-file m "tests.edn" (prn-str config))
119-
(integration/spit-file m test-file-path (str "(ns " prefix ".bar-test (:require [clojure.test :refer :all])) (deftest xxx-test (is (= :xxx :yyy)))"))
120-
121-
(future (deliver out-str (util/with-test-out-str
122-
(t/with-test-out
123-
(util/with-test-ctx
124-
(w/run* config finish? q))))))
125-
126-
(Thread/sleep 100)
127-
(integration/spit-file m test-file-path (str "(ns " prefix ".bar-test (:require [clojure.test :refer :all])) (deftest xxx-test (is (= :xxx :zzz)))"))
128-
(w/qput q (.resolve (:dir m) test-file-path))
129-
(Thread/sleep 500)
130-
(reset! finish? true)
131-
(w/qput q :finish)
132-
(Thread/sleep 100)
133-
134-
(is (str/includes?
135-
@out-str
136-
(str/replace
137-
(str/replace
138-
"[(F)]\n\nFAIL in foo.bar-test/xxx-test (bar_test.clj:1)\nExpected:\n :xxx\nActual:\n -:xxx +:yyy\n1 tests, 1 assertions, 1 failures.\n\nbin/kaocha --config-file PATH --focus 'foo.bar-test/xxx-test'\n\n[watch] Reloading #{foo.bar-test}\n[watch] Re-running failed tests #{:foo.bar-test/xxx-test}\n[(F)]\n\nFAIL in foo.bar-test/xxx-test (bar_test.clj:1)\nExpected:\n :xxx\nActual:\n -:xxx +:zzz"
139-
"foo"
140-
prefix)
141-
"PATH"
142-
(str config-file))))))
143-
144107
(deftest ignore-files-merged
145108
(let [{:keys [_config-file test-dir] :as m} (integration/test-dir-setup {})]
146109
(integration/spit-file m (str test-dir "/.gitignore") "one" )
@@ -155,8 +118,8 @@
155118
(is (= #{"one" "two"} (set (w/merge-ignore-files (str test-dir)))))))
156119

157120
(deftest watch-set-dynamic-vars-test
158-
; sanity test for #133. Should succeed when this file
159-
; is checked via ./bin/kaocha with --watch mode
121+
;; sanity test for #133. Should succeed when this file
122+
;; is checked via ./bin/kaocha with --watch mode
160123
(is (do (set! *warn-on-reflection* false)
161124
true))
162125
(let [{:keys [config-file test-dir] :as m} (integration/test-dir-setup {})

0 commit comments

Comments
 (0)