yacut/tester

Do not clear all tests when running file tests

Gert-dev opened this issue · 2 comments

Hello

This is a bit of an enhancement request, but I'd like to hear your thoughts on it. Currently, when you run the project tests, the results view displays all the results. If you then proceed to open a specific test file, this package will run the tests for that file (i.e. on open or save) if the appropriate setting is enabled.

I really like this behavior, especially the markers in the gutter that indicate the test status. However, would it be possible to not clear the entire state of the test results when that happens but instead update the results view with the status of the newly run tests?

Steps to reproduce:

  1. Run project tests, about 100 tests are executed. Their status is displayed in the results view.
  2. Open a file, about 5 tests are executed. The results of the other 95 tests are now gone, as the results view was cleared first.

Instead of this, I'd like my 100 tests to remain present in the results view, but the state of those 5 tests that have been rerun to be updated. If one of those tests now failed, its status is updated to indicate it failed.

I'm not sure if this requires any API changes or changes in the packages using the tester service, but technically this may work something like:

  • Running file tests requests provider to run tests for file. tester sees if each test in result is already in results view; updates if already present, inserts if not yet present (a clear never occurs).
  • Running project tests clears results view and fills it with all test results returned by provider(s) for entire project.
  • When opening file, tester fetches state of tests from internal manager, which contains the state of all project tests which were previously run. In other words, tester does not need to wait for file tests to complete to show gutter marks, except if project tests or specific file tests have not yet been run at that time.

What do you think?

yacut commented

Hello.
Thank you for your thoughts.
For this, I need to implement the state container (redux+observables) that already in roadmap.
Unfortunately I do not have much time right now for this. Maybe later. :(

yacut commented

I think the 1.3.0 release has this feature. Otherwise, please reopen the issue.