Skip to content

Commit

Permalink
Fix run-test-parallel
Browse files Browse the repository at this point in the history
The previous code references fixtures/f-tests, but there is no such
directory. The test case looks unfinished, so I'm not sure that there
ever was a working f-tests dir.

To fix the test case, I have adapted the code from run-test, just before
run-test-parallel.
  • Loading branch information
john-shaffer committed Aug 20, 2022
1 parent ae0863b commit 2502632
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions test/unit/kaocha/type/ns_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,12 @@
(testable/run testable testable)))))))

(deftest run-test-parallel
(classpath/add-classpath "fixtures/f-tests")

(let [testable (testable/load {:kaocha.testable/type :kaocha.type/clojure.test
:kaocha.testable/id :unit
:kaocha/ns-patterns ["-test$"]
:kaocha/source-paths ["src"]
:kaocha/test-paths ["fixtures/f-tests"]
:kaocha.filter/skip-meta [:kaocha/skip]})]
(classpath/add-classpath "fixtures/a-tests")

(let [testable (testable/load {:kaocha.testable/type :kaocha.type/ns
:kaocha.testable/id :foo.bar-test
:kaocha.testable/desc "foo.bar-test"
:kaocha.ns/name 'foo.bar-test})]
(is (match? {:kaocha.testable/type :kaocha.type/ns
:kaocha.testable/id :foo.bar-test
:kaocha.ns/name 'foo.bar-test
Expand All @@ -94,10 +91,10 @@
:kaocha.result/pending 0
:kaocha.result/fail 0}]}
(:result
(with-test-ctx {:fail-fast? true}
(with-test-ctx {:fail-fast? true :parallel true}
(testable/run testable testable)))))
(is (not (nil? (:result
(binding [testable/*config* (assoc testable/*config* :parallel true)]
(with-test-ctx {:fail-fast? true
:parallel true}
(testable/run testable testable)))))))))
(binding [testable/*config* (assoc testable/*config* :parallel true)]
(with-test-ctx {:fail-fast? true
:parallel true}
(testable/run testable testable)))))))))

0 comments on commit 2502632

Please sign in to comment.