Skip to content

Commit 1438ce7

Browse files
authored
Merge pull request #393 from lambdaisland/332-plugin-kaochapluginprofiling-does-not-run-when-watch-is-used
332 plugin kaocha plugin profiling does not run when watch is used
2 parents f868e6d + 1dc8802 commit 1438ce7

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
## Fixed
66

7+
- The watcher now prints the output from plugins, eg. `bin/kaocha --watch --plugin kaocha.plugin/profiling`
8+
79
## Changed
810

911
# 1.82.1306 (2023-03-30 / 40698c5)
@@ -1038,4 +1040,4 @@ namespace.
10381040
- The configuration format has changed, you should now start with the `#kaocha
10391041
{}` tagged reader literal in `tests.edn` to provide defaults. If you want more
10401042
control then overwrite `tests.edn` with the output of `--print-config` and
1041-
tweak.
1043+
tweak.

deps.edn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
:feature-docs
2929
{:extra-deps
30-
{lambdaisland/kaocha-cucumber {:mvn/version "0.0-53" :exclusions [lambdaisland/kaocha]}
31-
lambdaisland/open-source {:git/url "https://github.com/lambdaisland/open-source"
30+
{lambdaisland/kaocha-cucumber {:mvn/version "0.0-53" :exclusions [lambdaisland/kaocha]}
31+
lambdaisland/open-source {:git/url "https://github.com/lambdaisland/open-source"
3232
:git/sha "f42c1c48a3ca3376d9af37aa4cbcd95ba968b66f"
33-
#_#_:local/root "../open-source"}}}
33+
#_#_:local/root "../open-source"}}}
3434

3535
:dev
3636
{:extra-paths ["dev"]

src/kaocha/watch.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
(assoc ::tracker tracker)
5353
(update :kaocha/plugins #(cons ::plugin %)))
5454
result (try
55-
(api/run config)
55+
(plugin/run-hook :kaocha.hooks/post-summary (api/run config))
5656
(catch Throwable t
5757
(println "[watch] Fatal error in test run" t)))]
5858
(println)

test/unit/kaocha/watch_test.clj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,14 @@
132132
(Thread/sleep 100)
133133

134134
(is (str/includes?
135-
@out-str
136-
(str/replace
137-
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\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-
140-
"foo"
141-
prefix)))))
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))))))
142143

143144
(deftest ignore-files-merged
144145
(let [{:keys [_config-file test-dir] :as m} (integration/test-dir-setup {})]

0 commit comments

Comments
 (0)