Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to select tests to run

Discussion in 'Unity Build Automation' started by BNN06, May 4, 2022.

  1. BNN06

    BNN06

    Joined:
    Apr 22, 2022
    Posts:
    2
    Hello !

    Im working on Unit Test since 2 weeks and i was wondering if there is some possibility to make that only some selected test run.
    I got 6 Test file but i only want 2 of them to be run on unity cloud build.

    Is there any option to mark theme "ignored" ?
     
  2. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    432
    Hi,

    You can include/exclude any code from being compiled on Cloud Build by using the UNITY_CLOUD_BUILD scripting define directive. For example, wrap the tests you want to be excluded with the below if statement...

    #if !UNITY_CLOUD_BUILD

    Hope this helps!
     
  3. BNN06

    BNN06

    Joined:
    Apr 22, 2022
    Posts:
    2
    Thx a lot !
    I've find something else, i just put an [Ignore("reason")] attribute before the classname !
     
    ValeryNikulina likes this.