Commit graph

23 commits

Author SHA1 Message Date
Nathaniel Nicandro
1d8f28f2fc Simplify test macros
Also fix misuse of `alist-get`. `alist-get` uses `assq` for comparison by
default, but we are comparing strings. This caused issues when caching REPL
buffers and the subsequent re-use of them during testing.
2019-05-07 17:30:16 -05:00
Nathaniel Nicandro
112769e0c6
Bump version 2019-05-04 03:31:50 -05:00
Nathaniel Nicandro
c8dd1236df Generalize tests for Windows 2019-05-04 02:33:11 -05:00
Nathaniel Nicandro
cdc9d1fc6f Increase timeout when cleaning up test REPLs 2019-04-11 20:13:44 -05:00
Nathaniel Nicandro
b2294dceb2 Generalize communication with a kernel
The previous mechanism to communicate with a kernel was too low level from the
perspective of a client. The client interfaced directly with the subprocess
abstraction, `jupyter-ioloop`, and had to handle all "events" that occurred in
the `jupyter-ioloop`, e.g. when a channel was started or stopped. But in
reality such events should not be the concern of a client.

A client should only care about events that are directly related to kernel
messages and not events related to the implementation details of *how*
communication occurs.

This commit abstracts out the way in which a client communicates with its
kernel by introducing a new `jupyter-comm-layer` class. The
`jupyter-comm-layer` class takes care of managing the communication channel
between a kernel and its clients as well as sending events to all registered
clients. This way, clients operate solely at the level of events on the
communication layer. All a client does is register itself to receive events on
the communication layer and send events on the layer.

* jupyter-base.el (jupyter-session-endpoints): New function.

* jupyter-client.el (jupyter-kernel-client): Remove ioloop and channels slots.
  Add kcomm slot.
(initialize-instance): Unconditionally stop channels.
(jupyter-initialize-connection): Change into a method call.
Call `jupyter-initialize-connection` on the `kcomm` slot.
(jupyter-with-client-buffer): Remove stale comment.
(jupyter-send): Call `jupyter-send` on the `kcomm` slot.
(jupyter-ioloop-handler): Remove all method definitions, replace `sent` and
`message` methods with their `jupyter-event-handler` equivalents.
(jupyter-hb-pause, jupyter-hb-unpause, jupyter-hb-beating):
(jupyter-channel-alive-p, jupyter-start-channel, jupyter-stop-channel):
(jupyter-start-channels, jupyter-stop-channels):
Replace with calls to their equivalents using the `kcomm` slot.

* jupyter-comm-layer.el: New file.

* jupyter-kernel-manager (jupyter-make-client): Set a client's `kcomm` slot to
  `jupyter-channel-ioloop-comm`.

* jupyter-messages.el (jupyter-decode-message): Use `list` directly. There
  seemed to be issues when using the new `jupyter-sync-channel-comm` due to
  using quoted lists.

* test/jupyter-test.el: Add `jupyter-comm-layer` test. Update other tests.

* test/test-helper.el: Add `jupyter-comm-layer` mock objects. Update
  `jupyter-echo-client`.
2019-04-11 20:13:44 -05:00
Nathaniel Nicandro
460eba73ec
Update tests to consider changes in message handling 2019-03-29 12:57:54 -05:00
Nathaniel Nicandro
3f55bb0def jupyter-test-with-kernel-client: Consider a shutdown kernel 2019-03-17 01:59:00 -05:00
Nathaniel Nicandro
83af335166
Bump version 2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
e785b97963
Consider whitespace around org-mode src-block results in tests 2019-03-03 17:12:08 -06:00
Nathaniel Nicandro
b8067e70c8 Fix order of print format arguments 2019-02-22 08:30:00 -06:00
Nathaniel Nicandro
d927d3d58d
Test against the newest version of org-mode 2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
70f4b1b9a3
jupyter-org--append-stream-result: Consider org-edit-src-content-indentation 2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
7d72673604
Account for changes in org-mode 9.2
See #36. There were some assumptions being made on how `org-mode` interpreted
`fixed-width` elements which were changes in `org-mode` 9.2.
2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
7122b239e0
Move org-mode test setup functions to test/test-helper.el 2019-02-16 15:30:05 -06:00
Nathaniel Nicandro
1109681475 Add tests for jupyter-repl-syntax-propertize-function 2019-02-14 23:06:00 -06:00
Nathaniel Nicandro
dbaf9a5524
jupyter- -> jupyter-test- for test related macros 2019-01-23 19:41:46 -06:00
Nathaniel Nicandro
8e142b32f3
Fix file headers 2019-01-10 23:08:27 -06:00
Nathaniel Nicandro
4c16398448
jupyter-test-ipython-kernel-version: Set the process-environment
Needed to pick up `PYTHONPATH` settings and the like.
2019-01-10 23:08:27 -06:00
Nathaniel Nicandro
2d85d1a17a Update org-mode tests 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
82cea4c0d1 Break up large tests into smaller ones 2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
b67262f0f5 Take into account Travis' python version for tests 2018-11-16 13:37:14 -06:00
Nathaniel Nicandro
42cc3d3853 Do not use the make- prefix for struct constructors 2018-11-16 00:27:47 -06:00
Nathaniel Nicandro
75abea913d Update tests 2018-11-15 23:04:27 -06:00