MapsToPIETest

MapsToPIETest

#Overview

name: MapsToPIETest

The value of this variable can be defined or overridden in .ini config files. 3 .ini config files referencing this setting variable.

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MapsToPIETest is to specify a list of maps that should be tested in Play-in-Editor (PIE) mode during automated testing in Unreal Engine 5.

This setting variable is primarily used by the Unreal Engine’s automated testing system, specifically for PIE (Play-in-Editor) tests. It is referenced in the EditorTests plugin and the UnrealEd module.

The value of this variable is set in the project’s configuration, likely in the DefaultEngine.ini file under the [/Script/Engine.AutomationTestSettings] section. It is defined as a UPROPERTY in the UAutomationTestSettings class, which means it can be edited in the project settings within the Unreal Editor.

MapsToPIETest interacts with other variables and systems:

  1. It is used in conjunction with the bUseAllProjectMapsToPlayInPIE variable, which determines whether all project maps should be used for PIE testing instead of the specified list.
  2. If MapsToPIETest is empty, the system falls back to using default editor and game maps for testing.

Developers should be aware of the following when using this variable:

  1. It’s part of the automation testing framework and primarily used for CI/CD pipelines or automated testing scenarios.
  2. The maps specified should be valid and exist within the project to avoid test failures.
  3. Changes to this variable will affect the scope and duration of automated PIE tests.

Best practices when using this variable include:

  1. Regularly update the list to include new maps that need testing.
  2. Ensure that the maps listed are representative of different aspects of the game to provide comprehensive testing.
  3. Balance between thorough testing and test execution time by carefully selecting which maps to include.
  4. Use this in combination with other automation tests for a robust testing strategy.
  5. Regularly review and update the list based on project needs and development progress.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:97, section: [/Script/Engine.AutomationTestSettings]

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:98, section: [/Script/Engine.AutomationTestSettings]

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:99, section: [/Script/Engine.AutomationTestSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorIterationTests.cpp:24

Scope (from outer to inner):

file
function     void FIterationOpenAssets::GetTests

Source code excerpt:

{
	const UAutomationTestSettings* AutomationTestSettings = GetDefault<UAutomationTestSettings>();
	for ( FSoftObjectPath AssetRef : AutomationTestSettings->MapsToPIETest)
	{
		OutBeautifiedNames.Add(AssetRef.GetAssetName());
		OutTestCommands.Add(AssetRef.GetLongPackageName());
	}
}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp:1142

Scope: file

Source code excerpt:

/**
 * Generic Pie Test for projects.
 * By default this test will PIE the lit of MapsToPIETest from automation settings. if that is empty it will PIE the default editor and game (if they're different)
 * maps.
 *
 * If the editor session was started with a map on the command line then that's the only map that will be PIE'd. This allows project to set up tests that PIE
 * a list of maps from an external source.
 */
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FProjectMapsPIETest, "Project.Maps.PIE", EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)

/**
 * Execute the loading of one map to verify PIE works
 *
 * @param Parameters - Unused for this test
 * @return	TRUE if the test was successful, FALSE otherwise
 */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp:1196

Scope (from outer to inner):

file
function     bool FProjectMapsPIETest::RunTest

Source code excerpt:

	{
		// If the project has maps configured for PIE then use those
		if (AutomationTestSettings->MapsToPIETest.Num())
		{
			for (const FString& Map : AutomationTestSettings->MapsToPIETest)
			{
				PIEMaps.Add(Map);
			}
		}
		else
		{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Tests/AutomationTestSettings.h:377

Scope (from outer to inner):

file
class        class UAutomationTestSettings : public UObject

Source code excerpt:

	 */
	UPROPERTY(EditAnywhere, config, Category = "PIE Test Maps")
	TArray<FString> MapsToPIETest;

	/**
	 * Use all Maps from project for PlayMapInPIE test
	 */
	UPROPERTY(EditAnywhere, config, Category = "Play all project Maps In PIE")
	bool bUseAllProjectMapsToPlayInPIE;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Tests/AutomationCommon.cpp:891

Scope: file

Source code excerpt:

/**
 * Generic Pie Test for projects.
 * By default this test will PIE the lit of MapsToPIETest from automation settings. if that is empty it will PIE the default editor and game (if they're different)
 * maps.
 *
 * If the editor session was started with a map on the command line then that's the only map that will be PIE'd. This allows project to set up tests that PIE
 * a list of maps from an external source.
 */
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FProjectMapsCycleTest, "Project.Maps.Cycle", EAutomationTestFlags::ClientContext | EAutomationTestFlags::ProductFilter)

/**
 * Execute the loading of one map to verify PIE works
 *
 * @param Parameters - Unused for this test
 * @return	TRUE if the test was successful, FALSE otherwise
 */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Tests/AutomationCommon.cpp:947

Scope (from outer to inner):

file
function     bool FProjectMapsCycleTest::RunTest

Source code excerpt:

		// If the project has maps configured for PIE then use those
	#if 0
		if (AutomationTestSettings->MapsToPIETest.Num())
		{
			for (const FString& Map : AutomationTestSettings->MapsToPIETest)
			{
				CycleMaps.Add(Map);
			}
		}
		else
	#endif