Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug TestRunner tests from a package don't run on iOS device

Discussion in 'Editor & General Support' started by dynamicbutter, Jun 17, 2022.

  1. dynamicbutter

    dynamicbutter

    Joined:
    Jun 11, 2021
    Posts:
    63
    Problem: The TestRunner interface provides a way to "Run Selected Tests (iOS)". However, if these tests are from a package included in the project they do not seem to really get selected to run on the iOS device (though they do run fine when Mac build is selected). If the same tests are copied out from the package into a test assembly directly within the project they do run fine on iOS.

    The attached image illustrates the issue. Here "imagibee.Parallel.Tests.dll" are the package tests (that are exposed to the project via the "testables" attribute). "Tests.dll" are the same tests from the package that have been copied into a tests assembly within the "Muse" project.

    Screen Shot 2022-06-17 at 10.44.24 AM.png

    Steps to reproduce
    1. Unity 2021.3.2f1
    2. Create default 2d project
    3. Add package from git url with some tests (I used git@github.com:imagibee/com.imagibee.parallel.git#v0.1.1)
    4. Add "testables" attribute to project manifest to expose tests to project
    5. From Mac build can successfully "Run Selected Tests" from TestRunner
    6. Switch to iOS build (make sure player setting for automatic signing is configured)
    7. Select package tests (Imagibee.Parallel.Tests.dll)
    8. "Run Selected Tests (iOS)" builds successfully and runs something but test xml file shows that zero tests were selected.
    9. Create a new test assembly directly in the project and copy over the tests (Tests.dll)
    10. Select project tests (Tests.dll)
    11. "Run Selected Tests (iOS)" now works as expected
     
  2. dynamicbutter

    dynamicbutter

    Joined:
    Jun 11, 2021
    Posts:
    63
    Resolved: upgrading to 2021.3.5f1 resolved the issue.