Search Issue Tracker

Fixed in 1.1.22

Votes

8

Found in [Package]

1.0.0

Issue ID

DSTR-45

Regression

Yes

Build for UWP fails when "PlayMode tests for all assemblies" is enabled

Package: DS - Unity Test Framework

-

How to reproduce:
1.Download "New Unity Project.zip" and open "SampleScene" Scene
2. Build project for UWP

Expected result: Build for UWP succeeds with option "PlayMode tests for all assemblies" enabled
Actual result: Build for UWP fails with the option "PlayMode tests for all assemblies" enabled (see the attached 1208398.png)

Reproduced with: 2020.1.0a19, 2019.3.0f4, 2019.2.18f1
Regression introduced in: 2019.2.0a10

Note:
- When the build fails - there is an error in Console Window "UnityException: Failed to run reference rewriter with the command"

  1. Response avatar

    Resolution Note (fix version 1.1.22):

    The fix encourages people not to use the `Enable playmode tests for all assemblies` since are not needed anymore. Use assembly definition instead.
    Updated documentation as well https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/workflow-create-playmode-test.html

Comments (1)

  1. 1141b869ee5b66d1de51cf08713f948c?d=mm

    unity_kD973qMc5jKkGQ

    Jan 11, 2021 15:51

    The problem is that you are trying to include the TestAssembly definitions in the player build, which is a deprecated behavior. If you want to build for UWP you just need to remember to disable playmode tests for all assemblies from the dropdown menu by right clicking on Test Runner tab.
    The `playModeTestRunnerEnabled` flag, which is enabled or disabled from clicking the above-mentioned button, was used before the introduction of assembly definition files.
    It is no longer necessary, creating an empty Unity project the flag will by default set to 0 (disabled). If you really need to have the playmode tests for all assemblies enabled to run your tests inside the editor just remember to disable it before building the player.

    We recommend putting tests into separate assemblies and using assembly definition files. This way you will have more control over which assemblies need to reference test related dlls.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.