How can I disable seeing the tests of a upm package dependency in the testrunner ?

Hi,

I have UPM packageA and a project B which has a dependency on packageA.

PackageA has an Assembly Definition that is NOT autoreferenced, which includes it’s playmode tests, e.g. packageA.Tests.asmdef. This has a ref on UnityEngine.Testrunner.

If I open up the unity project B, which has packageA as a upm dependency, in the TestRunner i see all of packageA’s tests.

PackageA’s test assembly shouldn’t even be refernced by project B anyway, since it’s not autoreferenced, and there’s no reference on it. How can I disable Unity from including them in all tests ?

Cheers.

Found it: you need to add the UNITY_INCLUDE_TESTS constraint to PackageA’s test assembly. This signals unity test runner that it’s a test assembly of a package and doesn’t include it unless explicitly added to the testables in projectA’s manifest.