Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Automatically run tests before a build and cancel the build if the tests fail?

Discussion in 'Testing & Automation' started by AcademyOfFetishes, Apr 5, 2019.

  1. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    I have a
    IPreprocessBuildWithReport
    that I'm using. Is there a snippet of code I can put in there to run all tests before I build and set it to cancel the build if any tests fail? I've accidentally forgotten to do this before and sent people broken builds. I don't want to have to remember to do this every time when I could just script it (I hope).
     
  2. Warnecke

    Warnecke

    Unity Technologies

    Joined:
    Nov 28, 2017
    Posts:
    92
    Hey. Currently there is not an exposed way for code to trigger a test run. It is however something that we expect to have an API exposed for in the 2018.2 timeframe.
     
    AcademyOfFetishes likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    2019.2?
     
    aurelien-morel-ubiant likes this.
  4. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    Nice!
     
  5. Warnecke

    Warnecke

    Unity Technologies

    Joined:
    Nov 28, 2017
    Posts:
    92
    Yes, sorry. Meant to write 2019.2.
     
  6. arielsan

    arielsan

    Joined:
    Dec 3, 2013
    Posts:
    47
    Are you going to backport it?
     
  7. tim_lol

    tim_lol

    Joined:
    Jul 25, 2018
    Posts:
    14
    So, has the API been exposed? I looked through the patch notes and didn't see it mentioned.
     
  8. Warnecke

    Warnecke

    Unity Technologies

    Joined:
    Nov 28, 2017
    Posts:
    92
    Yes. It is exposed in version 1.1.0 of the package and forward. The package supports unity 2019.2+.
     
    Arkade and tim_lol like this.
  9. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    654
    That's great news. Is there doc/blog/tut on how we can do this? (auto-run tests and quit the build if they/subset fail?) Thx
     
  10. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Arkade likes this.
  11. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    654