fix(unit-tests): make tests opt-in via testables#12
fix(unit-tests): make tests opt-in via testables#12IvanMurzak merged 5 commits intoIvanMurzak:devfrom
Conversation
- Add "testables": ["extensions.unity.playerprefsex"] to Unity-Tests project manifests (2022.3, 2023.2, 6000.3) so package tests load only in those projects; other dependents do not list testables and do not load package tests by default. - Document in package README that tests are opt-in and that consumers must add the package to the testables array in Packages/manifest.json to run the package tests, with links to Unity testables and package-test docs. - Existing test asmdefs (optionalUnityReferences: TestAssemblies) already support the Test Framework; no asmdef changes required for testables.
There was a problem hiding this comment.
Pull request overview
This PR makes package tests opt-in for consumers by using Unity’s testables mechanism in the Unity test projects and documenting how to enable tests when desired.
Changes:
- Add
testables: ["extensions.unity.playerprefsex"]to the Unity-Tests project manifests for 2022.3, 2023.2, and 6000.3. - Update the package README to document that tests are opt-in and how to enable them via
Packages/manifest.json. - Update test asmdefs to rely on
optionalUnityReferences: ["TestAssemblies"]and remove explicit TestRunner/NUnit override references.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Unity-Tests/6000.3.1f1/Packages/manifest.json | Opt-in package tests via testables for the Unity 6000.3 test project. |
| Unity-Tests/2023.2.22f1/Packages/manifest.json | Opt-in package tests via testables for the Unity 2023.2 test project. |
| Unity-Tests/2022.3.62f3/Packages/manifest.json | Opt-in package tests via testables for the Unity 2022.3 test project. |
| Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef | Adjust runtime test assembly references to use optional test assemblies. |
| Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef | Adjust editor test assembly references to use optional test assemblies. |
| Unity-Package/Assets/root/README.md | Document how to opt in to running package tests using testables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
"testables": ["extensions.unity.playerprefsex"]to Unity-Tests project manifests (2022.3, 2023.2, 6000.3) so package tests load only in those projects; other dependents do not load package tests by default.testablesarray inPackages/manifest.jsonto run the package tests.optionalUnityReferences: TestAssemblies) support testables; no asmdef changes required for testables.Documentation