Search Unity

Question Is it possible to remove the unity's unit test from my tests?

Discussion in 'Testing & Automation' started by Kalita2127, Jun 5, 2023.

  1. Kalita2127

    Kalita2127

    Joined:
    Dec 6, 2014
    Posts:
    279
    As the title said I want to remove it from my tests. Any idea on how to do this?
    upload_2023-6-5_23-5-18.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    This is a setting in the respective package.json file. And since those are read-only, the only option you have is to either uninstall them or to copy the contents of the package into the assets folder, remove the tests, and also remove the installed package (which means you will not get package update notifications).

    I think you can also make your own menu items that filter out unwanted tests.

    A great IDE would let you filter and run these tests from within the IDE. Hint: said IDE is not from Microsoft. :D
     
  3. Kalita2127

    Kalita2127

    Joined:
    Dec 6, 2014
    Posts:
    279
    I think I want to try the filter method first since this isn't my personal project. But where do I put those? Do I just need to create a new c# file and put them? Sorry for the noob question.
     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    No, it isn't; it's in the manifest.json file for the project (which is editable). The "testables" section determines which packages in your project should be included in the test runner window.
     
  5. Kalita2127

    Kalita2127

    Joined:
    Dec 6, 2014
    Posts:
    279
    If I removed the com.unity.inputsystem it would raise an error because InputTestFixture not found
     
  6. sbergen

    sbergen

    Joined:
    Jan 12, 2015
    Posts:
    53
    This is a longstanding issue I don't believe there are any workarounds to. Essentially, it's impossible to currently ship both test utilities and tests in a Unity package, as testables works together with UNITY_INCLUDE_TESTS, which is used for both test utilities and tests. There's a thread discussing this somewhere, but I couldn't find it easily.