Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Test Runner not showing any of my tests

Discussion in 'Package Manager' started by rmenapace, Jan 25, 2019.

  1. rmenapace

    rmenapace

    Joined:
    Jul 12, 2018
    Posts:
    3
    I am trying to create a package with some tests in it, that I would like the projects that use the package to be able to run. I set the folders and assemblies up as described in the docs:

    ... but the tests do not show up in the test runner. Is there something else I need to do to make this work?
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Hi @menaspace,

    How is your package referred to by the project? If the package is *embedded* or a *local* package, it should show up in the test runner automatically.

    Also, where did you get this doc? It looks to be missing some information.

    Regards,

    Pascal
     
  3. rmenapace

    rmenapace

    Joined:
    Jul 12, 2018
    Posts:
    3
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Thanks for sharing. This document is indeed lacking for testing packages. The intention was to give an idea of how a package is structured if you ever looked inside one provided by Unity. We are working on more complete documentation for 2019.1 release in the Unity user manual. The goal of this documentation will be to assist you in creating your custom package.

    Back to helping you. Have you *embedded* the package?

    Pascal
     
  5. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,404
    • and by *embedded* you mean being put inside ProjectFolder/packages?
    • and by *local* ― inside ProjectFolder/Assets?
    • or vice versa?
    • or by *local* means referenced via "Add package from disk"?
    There are too many ways to consume a package. :D
     
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Hahaha. Indeed :p

    By *embedded*, I mean the package is physically located under the */Packages* folder
    By *local*, I mean referenced via "Add a package from disk". In the project manifest, the package version value set to a file path like "file:/some/path/"

    In both of these cases, your package tests should automatically show up in the test runner. If they don't, the issue is probably in the test configuration or assembly definition file settings.
     
  7. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,404
    If a custom package is *embedded*, its tests are available in the test runner. If it's *added from disk*, they are not. Can it be a configuration problem? I thought it's a feature.
     
  8. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
  9. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,404
    I don't see it as a bug. Packages *added from disk* behave the same way packages referenced from the registry do.

    If I want to customize a package and test the changes and/or add new tests, I do it in the *embedded* local copy. Seems reasonable, unless I misunderstand the purpose of these locally referenced packages. I treat them as released, not as work-in-progress ones.

    I also don't want *added from disk* packages to spam my VS solution with their test projects. Right now they don't. However I do realize that being included in the solution is not the same thing as being available in the test runner.
     
  10. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    @alexzzzz , It is hard to meet everyone's expectation. They are a lot of users developing their packages using the
    file:
    project dependency. In 2019.2, we will support local package tarballs. Those will be defined as immutable (i.e. tests won't show up in the tests runner). You could use this way of introducing local packages in your project when available. The only requirement will be to tar the package folder. Hope this will resolve your issue!

    Regards,

    Pascal
     
    jorgegalvaominiclip likes this.