Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Resolved NUnit in 5.6 and Editor Test Runner

Discussion in 'Testing & Automation' started by flintmech, Apr 25, 2017.

  1. flintmech

    flintmech

    Joined:
    Sep 29, 2011
    Posts:
    32
    Got a question or two about the Unity Test Tools deprecation in Unity 5.6.

    One of the sample scripts in the Asset Store package uses the [ExpectedException] attribute, which no longer compiles in Unity 5.6. With some Googling, I learned that Unity 5.6 upgraded to NUnit 3, which removes that attribute.

    So then I investigated Unity Test Tools to see if it would be updated on the Asset Store to be 5.6 compatible, which is when I stumbled across the Bitbucket for the package, announcing that Unity Test Tools is no longer supported in favor of a new built-in "Editor Test Runner" in Unity 5.6.

    But when I look up the documentation for 5.6's Editor Test Runner, it says:
    So I'm wondering if somebody can clarify: is there a contradiction here or am I misunderstanding? If Unity 5.6 ships with NUnit 3, can the built-in test runner feature still be based on NUnit 2.6.4? If Unity uses NUnit 2.6.4, why doesn't NUnit < 3.0 code compile, such as the ExpectedException attribute or Asset.IsNotNullOrEmpty?
     
  2. SHT_jhoareau

    SHT_jhoareau

    Joined:
    Mar 31, 2017
    Posts:
    1
    Hi flintmech,

    I had to implement Continuous Integration containing some tests using the Editor Test Runner. I thought that NUnit 2.6.4 was implemented. Errors occured when I tried to display report using a third party software implementing NUnit 2.6.4.

    With deeper research I found that the XML output file contained XML tags implemented since 3.0.0 release such as the <output> tag, replacing <message> (supposedly).

    I then installed a NUnit3 reporter and everything works well now.

    I would say that the Editor Test Runner uses NUnit3 considering what I found out above.
     
  3. flintmech

    flintmech

    Joined:
    Sep 29, 2011
    Posts:
    32
    Thanks for the feedback. That does seem to match what I've found with the broken APIs after upgrading to 5.6.

    It is looking like the problem is simply an error with the documentation... can't say I'd be surprised, sadly.