You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
+ Adding options to each test to determine the granularity at which CSV files are output. + Adding Material Perf test, which uses an input list of materials from your project settings and displays those materials in turn on a full-screen quad in a barebones scene, and collects performance data from each material + Adding Static Camera perf test base class and example implementation. This test is built in such a way that you can customize the method by which static cameras are gathered for the test. ++ The example usage looks for actors matching the AutomatedPerfTestStaticCamera class, and uses those as the set cameras. * Changing how the DataSourceName is constructed by the AutomatedPerfTestNodes so that by default it uses the activity of the test, and can be overridden via commandline * Fixing bug with Insights trace caching #jira UES-7376, UES-6570, UE-212203, UE-217719 #rb Arciel.Rekman #virtualized [CL 35926170 by matt oztalay in ue5-main branch]
143 lines
4.8 KiB
C#
143 lines
4.8 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using EpicGame;
|
|
using Gauntlet;
|
|
using Microsoft.Extensions.Logging;
|
|
using Log = EpicGames.Core.Log;
|
|
|
|
namespace AutomatedPerfTest
|
|
{
|
|
public class AutomatedPerfTestConfigBase : UnrealTestConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Used to override the test controller portion of the data source name
|
|
/// Will be appended to Automation.ProjectName to construct the full data source name for the test
|
|
/// can be overridden with AutomatedPerfTest.DataSourceNameOverride
|
|
/// </summary>
|
|
[AutoParamWithNames("AutomatedPerfTest.DataSourceTypeOverride")]
|
|
public string DataSourceTypeOverride = "";
|
|
|
|
/// <summary>
|
|
/// Fully override the data source name
|
|
/// </summary>
|
|
[AutoParamWithNames("AutomatedPerfTest.DataSourceNameOverride")]
|
|
public string DataSourceNameOverride = "";
|
|
|
|
/// <summary>
|
|
/// Name of the test, useful for identifying it later
|
|
/// </summary>
|
|
[AutoParamWithNames("AutomatedPerfTest.TestName")]
|
|
public string TestName = "";
|
|
|
|
/// <summary>
|
|
/// If set, will prepend platform name and use this device profile instead of the default
|
|
/// </summary>
|
|
[AutoParamWithNames("AutomatedPerfTest.DeviceProfileOverride")]
|
|
public string DeviceProfileOverride = "";
|
|
|
|
/// <summary>
|
|
/// If we're running on the build machine
|
|
/// </summary>
|
|
[AutoParamWithNames(false, "AutomatedPerfTest.DoInsightsTrace")]
|
|
public bool DoInsightsTrace;
|
|
|
|
/// <summary>
|
|
/// Which trace channels to test with
|
|
/// </summary>
|
|
[AutoParamWithNames("AutomatedPerfTest.TraceChannels")]
|
|
public string TraceChannels = "default,screenshot,stats";
|
|
|
|
/// <summary>
|
|
/// If we're running on the build machine
|
|
/// </summary>
|
|
[AutoParamWithNames(false, "AutomatedPerfTest.DoCSVProfiler")]
|
|
public bool DoCSVProfiler;
|
|
|
|
/// <summary>
|
|
/// If we're running on the build machine
|
|
/// </summary>
|
|
[AutoParamWithNames(false, "AutomatedPerfTest.DoFPSChart")]
|
|
public bool DoFPSChart;
|
|
|
|
/// <summary>
|
|
/// Let BuildGraph tell us where we should output the Insights trace after running a test so that we know where to grab it from when we're done
|
|
/// </summary>
|
|
[AutoParamWithNames("", "AutomatedPerfTest.PerfCacheRoot")]
|
|
public string PerfCacheRoot;
|
|
|
|
/// <summary>
|
|
/// Path to a JSON file with ignored issues (ensures, warnings, errros). Can be used to suppress hard-to-fix issues, on a per-branch basis
|
|
/// </summary>
|
|
[AutoParamWithNames("", "AutomatedPerfTest.IgnoredIssuesConfigAbsPath")]
|
|
public string IgnoredIssuesConfigAbsPath;
|
|
|
|
/// <summary>
|
|
/// If we should trigger a video capture
|
|
/// </summary>
|
|
[AutoParamWithNames(false, "AutomatedPerfTest.DoVideoCapture")]
|
|
public bool DoVideoCapture;
|
|
|
|
/// <summary>
|
|
/// If true, will look for the shipping configuration of Unreal Insights in order to parse Insights trace files
|
|
/// This should be True unless you need to test an issue in parsing the Insights file itself.
|
|
/// </summary>
|
|
[AutoParamWithNames(true, "AutomatedPerfTest.UseShippingInsights")]
|
|
public bool UseShippingInsights;
|
|
|
|
public string DataSourceName;
|
|
|
|
/// <summary>
|
|
/// Call this in the test node's GetConfiguration function to set the DataSourceName used for later data processing
|
|
/// </summary>
|
|
/// <param name="ProjectName">Name of the project</param>
|
|
/// <param name="DataSourceType">Which test controller is being used to generate the data</param>
|
|
/// <returns> the properly formatted data source name </returns>
|
|
public string GetDataSourceName(string ProjectName, string DataSourceType="")
|
|
{
|
|
// if the name has been fully overridden by the calling process, just use that
|
|
if (!string.IsNullOrEmpty(DataSourceNameOverride))
|
|
{
|
|
return DataSourceNameOverride;
|
|
}
|
|
|
|
// otherwise, if the data source type has been override, use either that or the one passed into this function
|
|
|
|
if (string.IsNullOrEmpty(DataSourceType) && string.IsNullOrEmpty(DataSourceTypeOverride))
|
|
{
|
|
Log.Logger.LogError("No DataSourceType or DataSourceTypeOverride has been provided.");
|
|
return null;
|
|
}
|
|
|
|
string dataSourceType = string.IsNullOrEmpty(DataSourceTypeOverride) ? DataSourceType : DataSourceTypeOverride;
|
|
|
|
return $"Automation.{ProjectName}.{dataSourceType}";
|
|
}
|
|
}
|
|
|
|
public class AutomatedSequencePerfTestConfig : AutomatedPerfTestConfigBase
|
|
{
|
|
/// <summary>
|
|
/// Which map to run the test on
|
|
/// </summary>
|
|
[AutoParamWithNames("", "AutomatedPerfTest.SequencePerfTest.MapSequenceName")]
|
|
public string MapSequenceComboName;
|
|
}
|
|
|
|
public class AutomatedStaticCameraPerfTestConfig : AutomatedPerfTestConfigBase
|
|
{
|
|
/// <summary>
|
|
/// Which map to run the test on
|
|
/// </summary>
|
|
[AutoParamWithNames("", "AutomatedPerfTest.StaticCameraPerfTest.MapName")]
|
|
public string MapName;
|
|
}
|
|
|
|
public class AutomatedMaterialPerfTestConfig : AutomatedPerfTestConfigBase
|
|
{
|
|
}
|
|
}
|