Performance Test Report: blank

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?

Which blog post are you referring to?

Apologies, I meant the Performance Testing Extension documentation

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).

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

using Unity.PerformanceTesting;
using UnityEngine;

namespace Tests
{
    public class PerformanceTestPlayMode
    {

        SampleGroupDefinition[] m_definitions =
        {
                new SampleGroupDefinition("Instantiate"),
                new SampleGroupDefinition("Instantiate.Copy"),
                new SampleGroupDefinition("Instantiate.Produce"),
                new SampleGroupDefinition("Instantiate.Awake"),
                new SampleGroupDefinition("Instantiate.Start")
        };

        [PerformanceTest]
        public void Instantiate_CreateCubes()
        {
            using (Measure.Scope())
            {
                using (Measure.Frames().Scope())
                {
                    // use ProfilerMarkers API from Performance Test Extension
                    using (Measure.ProfilerMarkers(m_definitions))
                    {
                        var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
                        for (var i = 0; i < 50000; i++)
                        {
                            UnityEngine.Object.Instantiate(cube);
                        }
                    }
                }
            }
        }
    }
}

.asmdef file

{
    "name": "TestsPlayMode",
    "references": [
        "Unity.PerformanceTesting"
    ],
    "optionalUnityReferences": [
        "TestAssemblies"
    ],
    "includePlatforms": [],
    "excludePlatforms": [],
    "allowUnsafeCode": false,
    "overrideReferences": false,
    "precompiledReferences": [],
    "autoReferenced": true,
    "defineConstraints": []
}

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.

private void LoadData()
{
     string filePath = Path.Combine(Application.streamingAssetsPath, "PerformanceTestResults.json");
     ...
}
1 Like