Make tests opt-in via testables and update documentation#13
Merged
IvanMurzak merged 7 commits intomainfrom Mar 11, 2026
Merged
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.
fix(unit-tests): make tests opt-in via testables
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the extensions.unity.playerprefsex Unity package to make package tests opt-in via Unity’s testables mechanism, and refreshes related docs/config to improve test discovery in sample Unity projects.
Changes:
- Bumps package version to
2.1.3. - Updates test
.asmdeffiles to rely onoptionalUnityReferences: ["TestAssemblies"]andUNITY_INCLUDE_TESTS. - Documents how to enable tests via
Packages/manifest.jsonand updates sample project manifests to include the package intestables.
Reviewed changes
Copilot reviewed 8 out of 8 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 | Adds testables entry so package tests load in the Test Runner for this sample project. |
| Unity-Tests/2023.2.22f1/Packages/manifest.json | Adds testables entry so package tests load in the Test Runner for this sample project. |
| Unity-Tests/2022.3.62f3/Packages/manifest.json | Adds testables entry so package tests load in the Test Runner for this sample project. |
| Unity-Package/Assets/root/package.json | Bumps package version to 2.1.3. |
| Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef | Adjusts runtime test assembly to use optional test references and UNITY_INCLUDE_TESTS. |
| Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef | Adjusts editor test assembly similarly, including UNITY_INCLUDE_TESTS. |
| Unity-Package/Assets/root/README.md | Adds documentation explaining opt-in test enablement via testables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the package version to 2.1.3 and improves the test configuration and documentation for the
extensions.unity.playerprefsexUnity package. The main focus is to clarify how to enable and run package tests, ensure test assemblies are properly configured, and update project manifests to support test discovery.Testing and Documentation Improvements:
README.mdexplaining how to enable and run the package's tests by adding the package to thetestablesarray inPackages/manifest.json, with links to relevant Unity documentation.Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef,Extensions.Unity.PlayerPrefsEx.Tests.asmdef) to useoptionalUnityReferencesforTestAssemblies, setUNITY_INCLUDE_TESTSindefineConstraints, and simplify references to improve test discoverability and compatibility. [1] [2]testablesarray in example Unity project manifests to ensure the package tests are loaded by the Unity Test Runner. [1] [2] [3]Version Updates:
package.jsonand theInstallerclass to reflect these changes. [1] [2]