예제 #1
0
        internal static void EndTest(ITest test)
        {
            if (test.IsSuite)
            {
                return;
            }
            if (test.FullName != Active.TestName)
            {
                return;
            }

            if (Active.m_PerformanceTestHelper != null && Active.m_PerformanceTestHelper.gameObject != null)
            {
                UnityEngine.Object.DestroyImmediate(Active.m_PerformanceTestHelper.gameObject);
            }

            DisposeMeasurements();
            Active.CalculateStatisticalValues();
            Active.EndTime = Utils.DateToInt(DateTime.Now);
            if (OnTestEnded != null)
            {
                OnTestEnded();
            }
            Active.LogOutput();

            TestContext.Out.WriteLine("##performancetestresult:" + JsonUtility.ToJson(Active));
            PlayerCallbacks.LogMetadata();
            Active = null;
            GC.Collect();
        }
예제 #2
0
        internal static void EndTest(ITest test)
        {
            if (test.IsSuite)
            {
                return;
            }
            if (test.FullName != Active.Name)
            {
                return;
            }

            if (Active.m_PerformanceTestHelper != null && Active.m_PerformanceTestHelper.gameObject != null)
            {
                UnityEngine.Object.DestroyImmediate(Active.m_PerformanceTestHelper.gameObject);
            }

            DisposeMeasurements();
            Active.CalculateStatisticalValues();
            OnTestEnded?.Invoke();
            Active.LogOutput();

            TestContext.Out.WriteLine("##performancetestresult2:" + JsonConvert.SerializeObject(Active));
            PlayerCallbacks.LogMetadata();
            Active = null;
            GC.Collect();
        }
예제 #3
0
        internal static void EndTest(ITest test)
        {
            if (test.IsSuite)
            {
                return;
            }
            if (test.FullName != Active.TestName)
            {
                return;
            }

            if (Active.m_PerformanceTestHelper != null && Active.m_PerformanceTestHelper.gameObject != null)
            {
                UnityEngine.Object.DestroyImmediate(Active.m_PerformanceTestHelper.gameObject);
            }

            DisposeMeasurements();
            Active.CalculateStatisticalValues();
            Active.EndTime = Utils.DateToInt(DateTime.Now);
            if (OnTestEnded != null)
            {
                OnTestEnded();
            }
            Active.LogOutput();

#if PERF_AGGREGATIONS_ONLY
            // For XR team peformance tests
            // The large collection of samples collected seems to cause
            // intermittent timeouts to the player connection.
            // We don't use these so reduing list count to 1
            // as the perf test data service expects at least one sample I think
            foreach (var sampleGroup in Active.SampleGroups)
            {
                if (sampleGroup.Samples.Count > 1)
                {
                    sampleGroup.Samples.RemoveRange(1, sampleGroup.Samples.Count - 1);
                }
            }
#endif
            TestContext.Out.WriteLine("##performancetestresult2:" + JsonUtility.ToJson(Active));
            TestContext.Out.WriteLine("##performancetestresult:" + JsonUtility.ToJson(Active));
            PlayerCallbacks.LogMetadata();
            Active = null;
            GC.Collect();
        }