/Engine/Source/Developer/FunctionalTesting/Public/AutomationBlueprintFunctionLibrary.h
Lets you know if any automated tests are running, or are about to run and the automation system is spinning up tests.
static bool AreAutomatedTestsRunning()