Skip to content

Commit

Permalink
Enable running tests in multiple namespaces
Browse files Browse the repository at this point in the history
Add two new commands: run loaded tests, run project tests.
Update test report to display results across multiple namespaces.

Closes #1226, closes #707
Requires clojure-emacs/cider-nrepl@e826247
  • Loading branch information
jeffvalk committed Feb 4, 2016
1 parent 0bbb991 commit 51bf460
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 75 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ and try to associate the created connection with this project automatically.
* Requires Java 7 or newer.
* Improve stacktrace presentation of compiler errors (readability, DWIM point positioning).
* [#1458](https://github.com/clojure-emacs/cider/issues/1458): Separate nREPL messages by connections instead of by sessions.
* [#1226](https://github.com/clojure-emacs/cider/issues/1226): Enable running of all loaded and all project tests.

### Bugs fixed

* [cider-nrepl#294](https://github.com/clojure-emacs/cider-nrepl/issues/294): Handle errors in the `complete-doc` nREPL op.
* [#1493](https://github.com/clojure-emacs/cider/issues/1493): Support special forms in eldoc.
* [#1529](https://github.com/clojure-emacs/cider/issues/1529): Close nREPL message buffer when you quit its matching connection.
* [#707](https://github.com/clojure-emacs/cider/issues/707): Better support clojure.test/with-test.

## 0.10.2 / 2016-01-27

Expand Down
6 changes: 5 additions & 1 deletion cider-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Returns to the buffer in which the command was invoked."
(define-key map (kbd "C-c ,") #'cider-test-run-tests)
(define-key map (kbd "C-c C-,") #'cider-test-rerun-tests)
(define-key map (kbd "C-c M-,") #'cider-test-run-test)
(define-key map (kbd "C-c M-<") #'cider-test-run-loaded-tests)
(define-key map (kbd "C-c C-<") #'cider-test-run-project-tests)

This comment has been minimized.

Copy link
@bbatsov

bbatsov Feb 4, 2016

Member

I think it's time for us to have a separate cider-test keymap. This would both free up some keybinding and simplify the lives of the users in terms of test discovery.

(define-key map (kbd "C-c C-t") #'cider-test-show-report)
(define-key map (kbd "C-c M-s") #'cider-selector)
(define-key map (kbd "C-c M-r") #'cider-rotate-default-connection)
Expand Down Expand Up @@ -244,7 +246,9 @@ Returns to the buffer in which the command was invoked."
["Go back" cider-pop-back])
("Test"
["Run test" cider-test-run-test]
["Run all tests" cider-test-run-tests]
["Run namespace tests" cider-test-run-tests]
["Run all loaded tests" cider-test-run-loaded-tests]
["Run all project tests" cider-test-run-project-tests]
["Rerun failed/erring tests" cider-test-rerun-tests]
["Show test report" cider-test-show-report])
"--"
Expand Down
Loading

9 comments on commit 51bf460

@bbatsov
Copy link
Member

@bbatsov bbatsov commented on 51bf460 Feb 4, 2016

Choose a reason for hiding this comment

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

Jeff, I'd also suggest to extend the documentation on the subject in the README (which is eventually going to become our website/user manual).

@jeffvalk
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just pushed e866869, documenting the additional functions in the README. I think this is pretty intuitive, but if you think it needs more, let me know.

@bbatsov
Copy link
Member

@bbatsov bbatsov commented on 51bf460 Feb 4, 2016

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@Malabarba
Copy link
Member

Choose a reason for hiding this comment

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

One more thing. I think the new faded background used on test results is hiding the red background that is used on the word “Fail”. For instance, on the following screenshot, the word Fail used to have the same bacground as the line “2 failures” above:
screenshot-2016-02-05--063429

@jeffvalk
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're right. I noticed this also, but found it easier on the eyes so I left it, at least for the moment. I'll see about restoring the highlighting.

@Malabarba
Copy link
Member

Choose a reason for hiding this comment

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

We could give the Fail word a red foreground instead of background (should be easier to do). The color makes the word standout in that wall of text, and that's pretty helpful to easily distinguish failures from errors.

@jeffvalk
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking exactly. The background there is a bit much.

@jeffvalk
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 463c3dc.

@Malabarba
Copy link
Member

Choose a reason for hiding this comment

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

👍☺

Please sign in to comment.