Skip to content
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

cider-auto-test-mode #1636

Merged
merged 2 commits into from
Mar 30, 2016
Merged

cider-auto-test-mode #1636

merged 2 commits into from
Mar 30, 2016

Conversation

Malabarba
Copy link
Member

A minor mode that runs tests after every successful load-file op.
I've been using this a lot lately, and I'm quite happy with it now.

It might make sense to also let the user run tests after every eval op (instead of just load-file). But I actually like that I can play around small code snippets with C-x C-e and C-M-x without accidentally reruning all tests, so I'm leaving this as is for now.

@Malabarba Malabarba force-pushed the tdd-mode branch 2 times, most recently from 5cf86b8 to 0fe70e0 Compare March 28, 2016 04:47
Only runs tests corresponding to the loaded file's namespace and does
nothing if no tests are defined or if the file failed to load."
nil nil nil
:global t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whi is this global?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Why would it be local? :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought people would be supposed to enable it using cider-mode-hook, but if you think this is a better idea - it's fine by me. Just mention the mode somewhere in the manual.

@bbatsov
Copy link
Member

bbatsov commented Mar 28, 2016

A minor mode that runs tests after every successful load-file op.
I've been using this a lot lately, and I'm quite happy with it now.

Looks good!

It might make sense to also let the user run tests after every eval op (instead of just load-file). But I actually like that I can play around small code snippets with C-x C-e and C-M-x without accidentally reruning all tests, so I'm leaving this as is for now.

Yeah, I think this should be a defcustom.

Btw, the final commit seems unrelated to the PR (and could use a changelog entry).

;;; Auto-test mode
(defun cider--test-silently ()
"Like `cider-test-run-tests', but with less feedback.
Only notify the user if there actually were any tests to run and only after
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of confused about this description - shouldn't this say you'll see the results only if something failed? I might be missing something, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it displays a message if the tests were successful. Otherwise you wouldn't know if the tests are finished or if they're hanging.

The point here is just to not bother the user if there are no tests to run.

@Malabarba
Copy link
Member Author

Yes, looks like I got my git messed up and pushed a wrong commit. Fixed

@bbatsov
Copy link
Member

bbatsov commented Mar 29, 2016

One more thing - mention this in the manual.

@Malabarba
Copy link
Member Author

One more thing - mention this in the manual.

How do I do that? :-)

@bbatsov
Copy link
Member

bbatsov commented Mar 30, 2016

Just edit the files under /doc. The manual will be updated automatically.

On Wednesday, 30 March 2016, Artur Malabarba [email protected]
wrote:

One more thing - mention this in the manual.

How do I do that? :-)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#1636 (comment)

Best Regards,
Bozhidar Batsov

https://www.batsov.com

@bbatsov
Copy link
Member

bbatsov commented Mar 30, 2016

Guess you can squash the final 3 commits together and we're good to go.

@bbatsov
Copy link
Member

bbatsov commented Mar 30, 2016

It also seems you'll have to rebase on top of the current master.

@Malabarba
Copy link
Member Author

All done. 👍

@bbatsov
Copy link
Member

bbatsov commented Mar 30, 2016

Hehe - this was fast! :-)

@bbatsov bbatsov merged commit 1367053 into master Mar 30, 2016
@bbatsov bbatsov deleted the tdd-mode branch March 30, 2016 16:00
@arichiardi
Copy link
Contributor

I just discovered cider-auto-test-mode and I wanted to thank you! This is an awesome feature!

@Malabarba
Copy link
Member Author

:-)

@arichiardi
Copy link
Contributor

Now I just need to add a defcustom in order to avoid the load-file confirmation 😄

@Malabarba
Copy link
Member Author

Is that a joke? :-)

@arichiardi
Copy link
Contributor

Lol, sorry now, it was half a question. :) When I do C-c C-l it asks me the file name every time and I checked a bit cider and I did not see how to disable it. Is it possible? If not, I can patch!

@Malabarba
Copy link
Member Author

Sorry, I think I sounded a bit rude. :-)
Yes, there is already a variable for doing exactly that, that's why I wasn't sure if you were joking or really asking. cider-prompt-save-file-on-load ;-)

@arichiardi
Copy link
Contributor

Ahah no probs, I sounded a bit silly in asking indeed, thanks a lot for the hint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants