Skip to content

Commit

Permalink
Merge pull request #393 from lambdaisland/332-plugin-kaochapluginprof…
Browse files Browse the repository at this point in the history
…iling-does-not-run-when-watch-is-used

332 plugin kaocha plugin profiling does not run when watch is used
  • Loading branch information
alysbrooks authored May 6, 2023
2 parents f868e6d + 1dc8802 commit 1438ce7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Fixed

- The watcher now prints the output from plugins, eg. `bin/kaocha --watch --plugin kaocha.plugin/profiling`

## Changed

# 1.82.1306 (2023-03-30 / 40698c5)
Expand Down Expand Up @@ -1038,4 +1040,4 @@ namespace.
- The configuration format has changed, you should now start with the `#kaocha
{}` tagged reader literal in `tests.edn` to provide defaults. If you want more
control then overwrite `tests.edn` with the output of `--print-config` and
tweak.
tweak.
6 changes: 3 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

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

:dev
{:extra-paths ["dev"]
Expand Down
2 changes: 1 addition & 1 deletion src/kaocha/watch.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
(assoc ::tracker tracker)
(update :kaocha/plugins #(cons ::plugin %)))
result (try
(api/run config)
(plugin/run-hook :kaocha.hooks/post-summary (api/run config))
(catch Throwable t
(println "[watch] Fatal error in test run" t)))]
(println)
Expand Down
15 changes: 8 additions & 7 deletions test/unit/kaocha/watch_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@
(Thread/sleep 100)

(is (str/includes?
@out-str
(str/replace

"[(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"

"foo"
prefix)))))
@out-str
(str/replace
(str/replace
"[(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"
"foo"
prefix)
"PATH"
(str config-file))))))

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

0 comments on commit 1438ce7

Please sign in to comment.