Skip to content

R: Modernize the session test architecture #1740

Description

@eitsupi

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions