Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Help Wanted 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:
    215
    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:
    26
    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:
    4,096
    2019.2?
     
    aurelien-morel-ubiant likes this.
  4. N3uRo

    N3uRo

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

    Warnecke

    Unity Technologies

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

    arielsan

    Joined:
    Dec 3, 2013
    Posts:
    27
    Are you going to backport it?