lambdaisland / kaocha

Full featured next gen Clojure test runner
https://cljdoc.org/d/lambdaisland/kaocha/
Eclipse Public License 1.0
803 stars 84 forks source link

Add capturing bypass #366

Closed plexus closed 1 year ago

plexus commented 1 year ago

When using the output-capturing plugin, it is sometimes desirable to bypass it and still print things directly.

See https://clojurians.slack.com/archives/CCY2V0U6A/p1670084873985659 for a workaround.

This applies the same logic, but provides a more generic bypass macro.

It seems FileDescriptor is not available in babashka, so until that changes this will be Clojure only.

codecov[bot] commented 1 year ago

Codecov Report

Base: 75.21% // Head: 75.42% // Increases project coverage by +0.20% :tada:

Coverage data is based on head (1c9ada5) compared to base (295791e). Patch coverage: 33.33% of modified lines in pull request are covered.

:exclamation: Current head 1c9ada5 differs from pull request most recent head 1266ab0. Consider uploading reports for the commit 1266ab0 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #366 +/- ## ========================================== + Coverage 75.21% 75.42% +0.20% ========================================== Files 51 51 Lines 2740 2734 -6 Branches 256 258 +2 ========================================== + Hits 2061 2062 +1 + Misses 518 510 -8 - Partials 161 162 +1 ``` | Flag | Coverage Δ | | |---|---|---| | integration | `57.00% <0.00%> (+0.03%)` | :arrow_up: | | unit | `69.45% <33.33%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/kaocha/core\_ext.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS9jb3JlX2V4dC5jbGo=) | `64.28% <ø> (ø)` | | | [src/kaocha/plugin/capture\_output.cljc](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS9wbHVnaW4vY2FwdHVyZV9vdXRwdXQuY2xqYw==) | `96.87% <0.00%> (ø)` | | | [src/kaocha/plugin/notifier.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS9wbHVnaW4vbm90aWZpZXIuY2xq) | `82.82% <ø> (ø)` | | | [src/kaocha/plugin/randomize.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS9wbHVnaW4vcmFuZG9taXplLmNsag==) | `95.23% <ø> (ø)` | | | [src/kaocha/runner.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS9ydW5uZXIuY2xq) | `46.80% <ø> (ø)` | | | [src/kaocha/type/var.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS90eXBlL3Zhci5jbGo=) | `83.33% <ø> (-1.29%)` | :arrow_down: | | [src/kaocha/watch.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS93YXRjaC5jbGo=) | `78.30% <ø> (+4.44%)` | :arrow_up: | | [src/kaocha/testable.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS90ZXN0YWJsZS5jbGo=) | `82.23% <100.00%> (ø)` | | | [src/kaocha/type/ns.clj](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2thb2NoYS90eXBlL25zLmNsag==) | `95.74% <0.00%> (-2.13%)` | :arrow_down: | | ... and [3 more](https://codecov.io/gh/lambdaisland/kaocha/pull/366?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

alysbrooks commented 1 year ago

Yeah, I had a conversation with Michiel Borkent when there was an earlier issue with FileDescriptor, and he said FileDescriptor probably wasn't a good candidate for addition to Babashka.

plexus commented 1 year ago

Released in v1.75.1190

[lambdaisland/kaocha "1.75.1190"]                 ;; deps.edn
{lambdaisland/kaocha {:mvn/version "1.75.1190"}}  ;; project.clj