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

Errors in Cloud build tests when asserting a color hex value

Discussion in 'Unity Build Automation' started by snotbubblelou, Oct 21, 2019.

  1. snotbubblelou

    snotbubblelou

    Joined:
    Jan 17, 2013
    Posts:
    15
    Hello,

    When turning on tests from Unity cloud builds, I am experiencing failures when I am not experiencing them on local machines (both Windows and Mac).

    Example:
    Locally when asserting on material color of that has a Hex value of BAEF19 works fine however when the same test runs on the cloud the Hex value is actually B3EC04.

    Is this a known issue?
     
  2. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    432
    This is not currently a known issue. Please can you log a support ticket with supporting reproduction information via the Cloud Build Developer Dashboard so that we can take a closer look at your project?
     
  3. snotbubblelou

    snotbubblelou

    Joined:
    Jan 17, 2013
    Posts:
    15
    Here is the cloud build failure:
    Code (CSharp):
    1. GivenFluorineWhenAtomIsRenderedThenColorIsFlourenceYellow
    2. String lengths are both 6. Strings differ at index 1. Expected: "BAEF19" But was: "B3EC04" ------------^
    3. at Tests.AtomTests+<GivenFluorineWhenAtomIsRenderedThenColorIsFlourenceYellow>d__6.MoveNext () [0x00073] in WORKSPACE_PATH/Assets/PlayModeTests/AtomTests.cs:91 at UnityEngine.TestTools.TestEnumerator+<Execute>d__5.MoveNext () [0x0004c] in WORKSPACE_PATH/Library/PackageCache/com.unity.test-framework@1.0.13/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs:31
    Here is the test
    Code (CSharp):
    1. UnityTest]
    2.         public IEnumerator GivenFluorineWhenAtomIsRenderedThenColorIsFlourenceYellow()
    3.         {
    4.             yield return null;
    5.  
    6.             var sut = GameObject.Find("Fluorine");
    7.             var actualColor = sut.GetComponent<MeshRenderer>().material.color;
    8.             var actual = ColorUtility.ToHtmlStringRGB(actualColor);
    9.  
    10.             Assert.That(actual, Is.EqualTo("BAEF19"));
    11.         }
    Attached is the test seen through the editor
     

    Attached Files: