Migrate existing comm tests to protocol-level tests
@lionel- is already working on this.
Since Mar 3, 2026.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
In recent PRs we've started using the DummyArkFrontend infrastructure for protocol-level tests of comms:
- https://github.com/posit-dev/ark/pull/1052 (variables)
- https://github.com/posit-dev/ark/pull/1060 (data explorer and variables)
- https://github.com/posit-dev/ark/pull/1067 (plots)
These tests are much nicer and effective than the old comm-based legacy tests because:
-
They exercise the whole kernel. This means that there is no need to simulate environment changed events after modifying the global env, which requires knowing a deeper knowledge of how internals work to produce a meaningful test (see https://github.com/posit-dev/ark/blob/239ee7e4d98101348fab833d1d668fd5a8d86b0b/crates/ark/tests/variables.rs#L116). We can let the normal operation of the kernel generate this sort of events.
-
It allows testing comms in conjunction with DAP and LSP operations and state. For instance the DAP now triggers comm-visible events, and it's nice to exercise these paths.
-
Inputs to the tests can be modelled after user requests, such as executing R code in the console. Compare to how we simulate global environment changes for Variables pane tests: https://github.com/posit-dev/ark/blob/239ee7e4d98101348fab833d1d668fd5a8d86b0b/crates/ark/tests/variables.rs#L109-L113
Before doing that though, we should solve https://github.com/posit-dev/ark/issues/689. This will allow comms to behave deterministically and tested with sequential assertions that are much stronger than fuzzy matching of events.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.