-
Notifications
You must be signed in to change notification settings - Fork 28
Add debug mode #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add debug mode #91
Conversation
Thanks for the nice write-up and all the testing. Just posting a comment to
acknowledge I've seen this, though haven't had time yet to look at it
closely. I'll attempt to do so within the next week, though it may need to
wait till this upcoming weekend.
…On Tue, Nov 12, 2024 at 3:20 PM paintparty ***@***.***> wrote:
Emulator Works? Truecolor? Preserves Scrollback?
iTerm ✅ ✅ ✅
Alacritty ✅ ✅ ✅
Terminal ✅ × ✅
Warp ✅ ✅ ✅
Kitty ✅ ✅ ×
WezTerm ✅ ✅ ×
Editor Works? Truecolor? Preserves Scrollback?
Intellij IDEA ✅ ✅ ✅
VSCode ✅ ✅ ✅
SublimeText (w Terminus) ✅ × ✅
SublimeText (w Terminus) ✅ × ✅
Hi!
Thanks for making test-refresh, great library!
I use test refresh, as intended, to automatically run tests in projects
that I'm working on.
Over time, I found that more often I would use test-refresh as a
hot-reloading system when working on JVM Clojure. This means I would
temporarily disable all tests and just call a single public function so
that I can observe the execution of the program at different points using
tapping/debugging macros from Fireworks
<https://github.com/paintparty/fireworks> that print and return forms.
You can get a sense of what this looks like by checking out the screen
recording below. It shows test-refresh running in an integrated editor
terminal, with the the editor's auto-save-with-delay automatically
triggering the reloads.
fw-tour-intro-light.gif (view on web)
<https://github.com/user-attachments/assets/55545e40-2e6a-4e96-a0e9-176fdc9ddb1c>
My global profile definded in ~/.lein/profiles.clj:
{:user {:dependencies [[pjstadig/humane-test-output "0.11.0"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:plugins [[com.jakemccrary/lein-test-refresh "0.5.5"]]
:test-refresh {:quiet true
:changes-only true
:notify-on-success false
;; New options:
;; Uncomment next 2 lines for debug mode
;; Comment them out if you want to run tests
:debug true
:banner "🔥"
;; Uncomment next line for custom banner in testing mode
;; :banner "📋 Running tests..."
;; This clears the console between reloads, preserving scrollback
:clear true
}}}
The 3 options that I added to enable this workflow:
:debug - Disables all tests and reporting. Surfaces errors. Defaults to
false
:banner - Allows user to supply their own banner. This can be used both
in :debug mode as well as the normal default test running mode. You can
supply an empty string to disable banner printing. If not supplied, current
test-refresh banner with stars is used.
:clear - Clears the terminal in between reloads, preserving scrollback.
When :debug is set to true, this is enabled by default. Defaults to false,
so user must opt-in to this feature when running tests.
I've tested the :clear feature on MacOS 12.6 with the following terminal
emulators:
------------------------------
You can view, comment on, or merge this pull request online at:
#91
Commit Summary
- f0025c3
<f0025c3>
Add :silence and :banner options
- d1820ce
<d1820ce>
Refine banner logic
- 1ffbf00
<1ffbf00>
Add debug mode
- 91c94eb
<91c94eb>
Refactor banner-printing logic
- e6276dc
<e6276dc>
Add clear option
File Changes
(4 files <https://github.com/jakemcc/test-refresh/pull/91/files>)
- *M* .gitignore
<https://github.com/jakemcc/test-refresh/pull/91/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947>
(1)
- *M* lein-test-refresh/src/leiningen/test_refresh.clj
<https://github.com/jakemcc/test-refresh/pull/91/files#diff-63b2f263508f0f01edcfc2028e194ee6fd46acc9ad67c533627a232f268f351b>
(26)
- *M* test-refresh/src/com/jakemccrary/test_refresh.clj
<https://github.com/jakemcc/test-refresh/pull/91/files#diff-f2a5551590c415f2d80366a857878c58ebd17b043eb8ed47039297f0b1214dca>
(35)
- *M* version.edn
<https://github.com/jakemcc/test-refresh/pull/91/files#diff-de858df6c37b279f3fda4ffcc97b9f72c8bed65c7012064e724b9d98fd1b8a9b>
(2)
Patch Links:
- https://github.com/jakemcc/test-refresh/pull/91.patch
- https://github.com/jakemcc/test-refresh/pull/91.diff
—
Reply to this email directly, view it on GitHub
<#91>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7HJXWHPVQUSDGPPYHU4D2AJWLLAVCNFSM6AAAAABRU7QTPGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2TGMZVGE2DCOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for the prompt reply. No rush at all. Look forward to hearing your thoughts after you get a chance to check it out. |
Sorry for the delay, this holiday season has sucked up more of my open-source time than I thought it would. I've taken a quick look and I think it is looking good, though I'm still planning on taking a deeper look and actually run it before merging. I'm hopeful that will happen either this week or next. Thanks for the contribution. Looking forward to getting it in. |
Thanks for the update @jakemcc! |
Seems mostly good to me, though it removes the default banner from the deps.edn code path since the resolving happens in a leiningen specific code path. This could be fixed by moving that code that does the defaulting over to the shared code. I'll merge and fix that. Thank you for the contribution |
Released as |
Hi!
Thanks for making
test-refresh
, great library!I use
test-refresh
, as intended, to automatically run tests in projects that I'm working on.Over time, I found that more often I would use
test-refresh
as a hot-reloading system when working in JVM Clojure. This means I would temporarily disable all tests and just call a single public function in my project so that I can observe the execution at different points using tapping/debugging macros from Fireworks that print and return forms. You can get a sense of what this looks like by checking out the screen recording below. It showstest-refresh
running in an integrated editor terminal, with the the editor's auto-save-with-delay automatically triggering the reloads. Just to be clear, this kind of hot-reloading workflow does not depend on Fireworks - it is achievable with similar libs such as playback, debux, hashp, telemere, ken, spyscope, omni-trace, postmortem, sayid, or the user's own hand-rolled debugging or tapping functions/macros:My global profile definded in
~/.lein/profiles.clj
:The 3 options that I added to enable this workflow:
:debug
- Disables all tests and reporting. Surfaces errors. Defaults tofalse
:banner
- Allows user to supply their own banner. This can be used both in:debug
mode as well as the normal default test running mode. You can supply an empty string to disable banner printing. If not supplied, currenttest-refresh
banner with stars is used.:clear
- Clears the terminal in between reloads, preserving scrollback. When:debug
is set to true, this is enabled by default. Defaults tofalse
, so user must opt-in to this feature when running tests.Testing:
I've tested the
:clear
feature on MacOS 12.6 with the following terminal emulators:And the following editor-integrated terminal emulators:
I haven't tested the
:clear
feature on linux but would expected similar results as above.I wouldn't expect the
:clear
feature to work on windows, but I think that could be easily added in the future.