FineCodeCoverage icon indicating copy to clipboard operation
FineCodeCoverage copied to clipboard

Causes all tests to be run in background

Open JDizzle777 opened this issue 3 years ago • 1 comments

Installed product versions

  • Visual Studio 2022
  • Fine Code Coverage 1.1.180
  • MsTest Framework 2.2.10

Description

With this extension installed on a test project, every time you run a single test (or just a few tests), every test in the project will run (in the background). It looks like only the test you selected ran, but in reality, all the tests ran.

Steps to recreate

Prerequisites:

  • this extension installed
  • a MSTest Test Project (haven't tried other test frameworks i.e. NUnit, XUnit, etc) created with multiple different tests.
  • An easy way to repro is to create 3 tests - each test does something like: File.WriteAllText(@"C:\Test1.txt", "Test1"); - but with different file names for each test i.e. Test2.txt, etc
  1. Have file explorer open to the location where the files will be created.
  2. Run just 1 of the tests.
  3. Observe the txt file created as expected.
  4. Wait about 2-5 seconds
  5. More txt files are created from the other tests being run in the background.
  6. Remove Fine Code Coverage extension and try again.
  7. Issue no longer happens.

Side Notes

  • I've attached a screen record of the issue.
  • I tried uploading my sample solution in a zip file, but the upload would not work.
  • Here's the contents of the test file I used:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;

namespace TestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            File.WriteAllText(@"C:\Test1.txt", "Test1");
        }

        [TestMethod]
        public void TestMethod2()
        {
            File.WriteAllText(@"C:\Test2.txt", "Test2");
        }

        [TestMethod]
        public void TestMethod3()
        {
            File.WriteAllText(@"C:\Test3.txt", "Test3");
        }
    }
}

https://user-images.githubusercontent.com/5551174/184223763-0fef7666-f580-4fad-95b4-97b0f8f1a315.mp4

JDizzle777 avatar Aug 11 '22 19:08 JDizzle777

Duplicate of https://github.com/FortuneN/FineCodeCoverage/issues/267

Please use the option for ms code coverage. Although until the next release there is an issue with async coverage.

tonyhallett avatar Aug 11 '22 19:08 tonyhallett