posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 91 forks source link

Add Positron instantiation service test helpers; refactor tests to use runtime services #5335

Closed seeM closed 1 week ago

seeM commented 1 week ago

This is in preparation for writing unit tests for the runtime session service since I intend on making changes to it for #2671.

The main addition is the positronWorkbenchInstantiationService function, which sets up a test instantiation service with a bunch of test dummies, following upstream's workbenchInstantiationService function. I also refactored our existing unit tests to use the new function.

QA Notes

  1. Positron unit tests should pass. They can be run locally with:

    ./scripts/test-positron.sh
  2. There are a few minor code changes to runtime-related code, mainly to fix leaked disposables, which could use a review.