jakemcc / test-refresh

Refreshes and reruns clojure.tests in your project.
393 stars 28 forks source link

`:quiet` flag is ignored under `deps/cli` #88

Closed cloojure closed 1 year ago

cloojure commented 1 year ago

Use the template below when reporting bugs. Please make sure the problem is still a problem with the latest version of lein-test-refresh before submitting.

What version of lein-test-refresh? 0.25.0

What version of Leiningen? n/a - using deps/cli

Can you recreate the issue with a minimal project? Easy to see at https://github.com/cloojure/tupelo Current SHA is ed64521572d92e96e3e988a064b949f8400cd305 (tip of master)

I have only 1 test specified using :test-refresh/focus (via the macro dotest-focus) seen here: https://github.com/cloojure/tupelo/blob/master/test/cljc/tst/tupelo/core.cljc#L2024

Result of running clojure -M:test-refresh is:


*********************************************
*************** Running tests ***************
:reloading ()

Testing tst.tupelo.async

Testing tst.tupelo.base64

Testing tst.tupelo.base64url

Testing tst.tupelo.bits

Testing tst.tupelo.csv

Testing tst.tupelo.cuid

Testing tst.tupelo.cuid.prng

Testing tst.tupelo.demo

Testing tst.tupelo.deprecated

Testing tst.tupelo.dev

Testing tst.tupelo.forest

Testing tst.tupelo.forest-examples

Testing tst.tupelo.io

Testing tst.tupelo.java-time

Testing tst.tupelo.java-time.convert

Testing tst.tupelo.java-time.epoch

Testing tst.tupelo.math.modular-arithmetic

Testing tst.tupelo.parse.tagsoup

Testing tst.tupelo.parse.xml

Testing tst.tupelo.parse.yaml

Testing tst.tupelo.profile

Testing tst.tupelo.spec

Testing tst.tupelo.splat

Testing tst.tupelo.tagstr

Testing tst.tupelo.test

Testing tst.tupelo.types

Testing tst.tupelo.uuid

Testing tst.tupelo.var-demo

Testing tst.tupelo.x.data

Testing tst.tupelo.x.specter

Testing tst.tupelo.y64

Testing tst._bootstrap

Testing tst.tupelo.array

Testing tst.tupelo.array.mutable

Testing tst.tupelo.chars

Testing tst.tupelo.core

Testing tst.tupelo.core.snip

Testing tst.tupelo.hierarchy

Testing tst.tupelo.interval

Testing tst.tupelo.lazy

Testing tst.tupelo.lexical

Testing tst.tupelo.math

Testing tst.tupelo.misc

Testing tst.tupelo.parse

Testing tst.tupelo.quote

Testing tst.tupelo.schema

Testing tst.tupelo.set

Testing tst.tupelo.string

Testing tst.tupelo.string.safe

Testing tst.tupelo.tagval

Testing tst.tupelo.types.coerce

Testing tst.tupelo.vec

Ran 1 tests containing 2 assertions.
0 failures, 0 errors.

Passed all tests
Finished at 11:41:50.359 (run time: 0.040s)

So you can see it is only running one section of one NS. However, all NS's are printed on the output.

jakemcc commented 1 year ago

I took a brief look at this and confirmed this is the same behavior for Leiningen projects as well.

I believe this is happening because the functions that deftest ends up still exist but the test implementation has been moved so it isn't at the :test metadata on that function.

Relevant code:

This might be fixable by figuring out how to stop having test-ns called if every test would be skipped in that namespace but it isn't something I'm going to dig into.

I'd suggest turning on the :quiet true flag in .test-refresh.edn to hide the output and enjoying having less noisy test output :).

jakemcc commented 1 year ago

Also, thanks for continuing to submit reproducible issue reports. Makes looking into these things way easier.

cloojure commented 1 year ago

OK, problem solved. I had accidentally used test-refresh.edn instead of .test-refresh.edn. Doh! Alan

On Sun, Mar 5, 2023 at 4:11 PM Jake McCrary @.***> wrote:

Also, thanks for continuing to submit reproducible issue reports. Makes looking into these things way easier.

— Reply to this email directly, view it on GitHub https://github.com/jakemcc/test-refresh/issues/88#issuecomment-1455258646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWBOB5NKMK7LNNWPP5V2BDW2UTT7ANCNFSM6AAAAAAVO74PVE . You are receiving this because you authored the thread.Message ID: @.***>

jakemcc commented 1 year ago

:tada:, it is nice when problems are easy to solve :).

If some of my responses seemed weird it is because I forgot to look at the title of this issue and forgot that the title was about the :quiet flag and thought the concern was just about the output. Sorry about that. Reading is hard.