Search Unity

Performance Test Report: blank

Discussion in 'Editor & General Support' started by bgulanowski, Jul 24, 2019.

  1. bgulanowski

    bgulanowski

    Joined:
    Feb 9, 2018
    Posts:
    36
    I think I'm following the directions from the blog post correctly. My performance tests results show up in the Test Runner in the editor. The "Refresh" button in the Report window responds to my clicks OK. But nothing shows up. Is it me? Are there any other resources for this feature?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Which blog post are you referring to?
     
  3. bgulanowski

    bgulanowski

    Joined:
    Feb 9, 2018
    Posts:
    36
  4. termway

    termway

    Joined:
    Jul 5, 2012
    Posts:
    84
    Same here, i have tried XRAutomatedTests repository and it's work, but I cannot have the same result on my project. It's compiling and running but there is not result on Test report. (Unity 2018.4.6f1).

    empty_result.png

    I have copy/pasta serveral performance test but it doesn't really work.

    Code (CSharp):
    1. using Unity.PerformanceTesting;
    2. using UnityEngine;
    3.  
    4. namespace Tests
    5. {
    6.     public class PerformanceTestPlayMode
    7.     {
    8.  
    9.         SampleGroupDefinition[] m_definitions =
    10.         {
    11.                 new SampleGroupDefinition("Instantiate"),
    12.                 new SampleGroupDefinition("Instantiate.Copy"),
    13.                 new SampleGroupDefinition("Instantiate.Produce"),
    14.                 new SampleGroupDefinition("Instantiate.Awake"),
    15.                 new SampleGroupDefinition("Instantiate.Start")
    16.         };
    17.  
    18.         [PerformanceTest]
    19.         public void Instantiate_CreateCubes()
    20.         {
    21.             using (Measure.Scope())
    22.             {
    23.                 using (Measure.Frames().Scope())
    24.                 {
    25.                     // use ProfilerMarkers API from Performance Test Extension
    26.                     using (Measure.ProfilerMarkers(m_definitions))
    27.                     {
    28.                         var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
    29.                         for (var i = 0; i < 50000; i++)
    30.                         {
    31.                             UnityEngine.Object.Instantiate(cube);
    32.                         }
    33.                     }
    34.                 }
    35.             }
    36.         }
    37.     }
    38. }
    .asmdef file
    Code (JavaScript):
    1. {
    2.     "name": "TestsPlayMode",
    3.     "references": [
    4.         "Unity.PerformanceTesting"
    5.     ],
    6.     "optionalUnityReferences": [
    7.         "TestAssemblies"
    8.     ],
    9.     "includePlatforms": [],
    10.     "excludePlatforms": [],
    11.     "allowUnsafeCode": false,
    12.     "overrideReferences": false,
    13.     "precompiledReferences": [],
    14.     "autoReferenced": true,
    15.     "defineConstraints": []
    16. }
     
  5. JasonGriffithFF

    JasonGriffithFF

    Joined:
    Nov 24, 2019
    Posts:
    2
    So, I figured this out.

    It's because if you are on a version before 2019.1, PerformanceTestRunSaver.cs is saving the test data to the Application.streamingAssetsPath instead of the Application.persistentDataPath where the Test Report window is looking for it.

    I changed the code in TestReportWindow.cs to look for it at the streamingAssetsPath instead.

    Code (CSharp):
    1. private void LoadData()
    2. {
    3.      string filePath = Path.Combine(Application.streamingAssetsPath, "PerformanceTestResults.json");
    4.      ...
    5. }
     
    Last edited: Dec 13, 2019
    Darkgaze likes this.