|
62 | 62 |
|
63 | 63 | (make-obsolete 'cider-test-defining-forms nil "1.8.0") |
64 | 64 |
|
| 65 | +(defvar cider-test--current-repl nil |
| 66 | + "Contains the reference to the REPL where the tests were last invoked from. |
| 67 | +This is needed for *cider-test-report* navigation |
| 68 | +to work against the correct REPL session.") |
| 69 | + |
65 | 70 | (defvar cider-test-last-summary nil |
66 | 71 | "The summary of the last run test.") |
67 | 72 |
|
@@ -289,7 +294,8 @@ prompt and whether to use a new window. Similar to `cider-find-var'." |
289 | 294 | cider-auto-select-error-buffer |
290 | 295 | #'cider-stacktrace-mode |
291 | 296 | 'ancillary) |
292 | | - (reverse causes)))))))))) |
| 297 | + (reverse causes))))))) |
| 298 | + cider-test--current-repl))) |
293 | 299 |
|
294 | 300 | (defun cider-test-stacktrace () |
295 | 301 | "Display stacktrace for the erring test at point." |
@@ -710,6 +716,7 @@ running them." |
710 | 716 | ;; we generate a different message when running individual tests |
711 | 717 | (cider-test-echo-running ns (car tests)) |
712 | 718 | (cider-test-echo-running ns))) |
| 719 | + (setq cider-test--current-repl conn) |
713 | 720 | (let* ((retest? (eq :non-passing ns)) |
714 | 721 | (request `("op" ,(cond ((stringp ns) "test") |
715 | 722 | ((eq :project ns) "test-all") |
@@ -746,15 +753,18 @@ running them." |
746 | 753 | (cider-test-echo-summary summary results elapsed-time) |
747 | 754 | (if (or (not (zerop (+ error fail))) |
748 | 755 | cider-test-show-report-on-success) |
749 | | - (cider-test-render-report |
750 | | - (cider-popup-buffer |
751 | | - cider-test-report-buffer |
752 | | - cider-auto-select-test-report-buffer) |
753 | | - summary |
754 | | - results |
755 | | - elapsed-time |
756 | | - ns-elapsed-time |
757 | | - var-elapsed-time) |
| 756 | + (let ((b (cider-popup-buffer |
| 757 | + cider-test-report-buffer |
| 758 | + cider-auto-select-test-report-buffer))) |
| 759 | + (with-current-buffer b |
| 760 | + (setq-local default-directory nil)) |
| 761 | + (cider-test-render-report |
| 762 | + b |
| 763 | + summary |
| 764 | + results |
| 765 | + elapsed-time |
| 766 | + ns-elapsed-time |
| 767 | + var-elapsed-time)) |
758 | 768 | (when (get-buffer cider-test-report-buffer) |
759 | 769 | (with-current-buffer cider-test-report-buffer |
760 | 770 | (let ((inhibit-read-only t)) |
|
0 commit comments