microsoft / microsoft/nodejstools

TestContainersUpdated events are not sent on project open/close

Open
#2,184 2 comments 1 reaction 1 assignee View on GitHub

@armanio123 is already working on this.

Since Jun 27, 2019.

Dominant language
C#
Stars
1.8k
Forks
355
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

The TestContainerDiscoverer class is responsible for notifying the TestWindow of containers where tests should be discovered. It should call the TestContainersUpdated event whenever tests could potentially have changed.

My expectation is that OnProjectLoaded and OnProjectUnloaded should send the TestContainersUpdated event.

Actual Behavior

If you would put a breakpoint you can see that the OnTestContainersChanged is called, but the if condition evaluates to false and the event isn't actually sent, meaning that tests don't get removed on project close and don't get discovered on project open.

  • NTVS Version: 1.5.10610.1 Commit Hash:529a87de2769e143655e31ea81795c42e5775ef8
  • Visual Studio Version: 16.2 preview 4
  • Node.js Version: 8.1.4
Steps to Reproduce
  1. Open a nodejs project
  2. Run build to discover tests
  3. Unload the project
  4. If the event would have been sent successfully the tests for the unloaded project should disappear

In the OnProjectUnloaded method the project is removed from knownProjects and this makes the if condition always fail, whereas in the OnProjectLoaded method the newly created project has HasRequestedContainers set to false making the if condition always fail.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.