R: Modernize the session test architecture

Open
#1,740 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
r, typescript

Research direction

Start by locating the bundled tinytest suite and the session E2E tests that use Terminal.sendText() with fixed sleeps. Compare their startup path with R_PROFILE_USER and inspect how transport tests model Unix sockets and Windows named pipes. Done means incremental tests are separated by layer, synchronize deterministically, and identify the failing layer.

Written by the indexing model from the issue text.

Description

Background

While working on #1739, several weaknesses in the current R/session tests became apparent.

For example:

  • the bundled tinytest suite was not run in CI;
  • some existing tests had already become stale;
  • session E2E tests rely heavily on Terminal.sendText() plus fixed sleeps/timeouts;
  • failures in R evaluation, callbacks, IPC, and VS Code handling often all appear as the same timeout;
  • tinytests do not reproduce vscode-R's actual R startup path through R_PROFILE_USER;
  • some transport tests use pipe primitives that do not exactly match production Unix sockets / Windows named pipes.

Proposal

Modernize the tests incrementally, roughly separating them into:

  1. R-level tests — runtime lifecycle, hooks, options, Data Viewer state, cleanup.
  2. sess transport tests — real socket/named-pipe request/response, disconnect and reconnect behavior.
  3. interactive R E2E — launch a real R session and deterministically observe startup, command completion, task callbacks, and prompt return.
  4. VS Code E2E — keep a smaller set of tests for terminal creation, workspace updates, plots, View(), etc.

In particular, we should reduce sendText() + sleep + waitFor() style synchronization and make failures identify which layer actually failed.

This does not need to be a large rewrite. The goal is to improve the suite incrementally so it is more deterministic, closer to real usage, and easier to debug and extend.

Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
3h 33m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from REditorSupport/vscode-R

All issues in REditorSupport/vscode-R

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.