Search Unity

TestRunner fails all tests when running more than one test assembly

Discussion in 'Testing & Automation' started by jmguillemette, Oct 23, 2021.

  1. jmguillemette

    jmguillemette

    Joined:
    Mar 4, 2015
    Posts:
    53
    - I have two test assemblies.
    -The first does some basic scene loading tests and utility code tests.
    - The second does some character controller movement tests.

    Both tests assemblies 100% when run.

    But when I run them via "RunAll"

    The first test assembly passes and the second 100% fails.
    (The symptom appears to be that the character controller used by the test stops working entirely if run after another test assembly. Thus all the checks for moving correctly fail)

    I am at a loss as to why this is. The code in the first assembly would not impact the scene or game state to affect the second assembly in any way.

    When run separately :

    upload_2021-10-23_14-30-33.png

    when run via RunAll

    upload_2021-10-23_14-31-35.png
     
  2. jmguillemette

    jmguillemette

    Joined:
    Mar 4, 2015
    Posts:
    53
    problem found.
    it was in the users code.
    The first package had a static variable that was being changed by the first set of tests and then no properly reset. Since this was static it persisted the library switch.