|
104 | 104 | (spit tmp-file "#kaocha/v1 {:tests [{:id :foo}]}") |
105 | 105 | (first (w/reload-config {:kaocha/cli-options {:config-file (str tmp-file)}} [])))))) |
106 | 106 |
|
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 | | - |
144 | 107 | (deftest ignore-files-merged |
145 | 108 | (let [{:keys [_config-file test-dir] :as m} (integration/test-dir-setup {})] |
146 | 109 | (integration/spit-file m (str test-dir "/.gitignore") "one" ) |
|
155 | 118 | (is (= #{"one" "two"} (set (w/merge-ignore-files (str test-dir))))))) |
156 | 119 |
|
157 | 120 | (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 |
160 | 123 | (is (do (set! *warn-on-reflection* false) |
161 | 124 | true)) |
162 | 125 | (let [{:keys [config-file test-dir] :as m} (integration/test-dir-setup {}) |
|
0 commit comments