We have a need for an automation project that is part of a plugin. https://dev.epicgames.com/documentation/en-us/unreal-engine/create-an-automation-project-in-unreal-engine seems to indicate this can go in `<PROJECT_ROOT>\Build\Scripts`. This appears to be confirmed by `ICVFX.Automation.csproj` being in that location in the `VirtualProduction` plugin.
However, this approach didn’t appear to work. Investigation lead to the following issues:
- The documentation on how to create an automation project is fairly dated it seems, and doesn’t align with how projects are actually setup. In the end it was more successful to copy and adjust an existing automation.csproj file
- The code in `Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs` which tries to locate automation.csproj files will only look under `Source` and `Test` directories in plugins
- BUT - this lead to another finding, a divergence between the UE source in git and perforce. As part of 5.6 work, it appears logic was added to also scan the `Build` directory. This code doesn’t appear in perforce in ue5-main - it does appear in one of the other streams, but the history almost makes it look like a change was submitted to ue5-main that included this addition and was subsequently removed/obliterated - which resulted in a divergence.
So the questions are as follows:
Are automation projects supposed to be supported in plugins, and if so is the additional to scan the `Build` directory desired? It would make the project file generator align better with the documentation and with how automation.csproj files are usually positioned in projects. I was going to backport the 5.6 change to our 5.5 code when I noticed the code was actually missing in Perforce.
So… what’s going on with the divergence between git and perforce?
Hi,
I checked GitHub files, and they look ok. The code in UE 5.6 and ue5-main should look like below and the file I checked matches this:
foreach (FileReference PluginFile in PluginsBase.EnumeratePlugins(PluginsFolder)) { Folders.Add(DirectoryReference.Combine(PluginFile.Directory, "Source")); Folders.Add(DirectoryReference.Combine(PluginFile.Directory, "Tests")); Folders.Add(DirectoryReference.Combine(PluginFile.Directory, "Build")); // this is to pick up plugin's C# automation projects }
The associated JIRA task was described as following and the comment in the code hints that plugins automation is expected to be available.
Right now C# parts of AutomatedPerfTesting are only compiled if some sample in the source tree has a C# project that includes them (which is the case for a CitySample for example). This needs to be more robust and the C# code in a plugin should be always compiled. Either move it to UAT or find another way to have them picked up.
So if you are on 5.5, you can backport this change. Note that the original fix was made, then backed out (for some reasons) and resubmitted in P4. This might explain the confusion. This is the GitHub submit corresponding to the change: https://github.com/EpicGames/UnrealEngine/commit/43150c23b8d48ee3195d46e5aef0caade06f6f5d. I assume that if the automation project is compiled, it should work… but I didn’t test. Let me know how it goes.
Regards,
Patrick
Hi,
No problems, just glad the P4/Git depots are as expected. Let me know if you encounter some other problems with the automation part.
Regards,
Patrick
Cheers. That said, I do think something is up with perforce, maybe related to licensee views? See the following output:
PS> p4 filelog //UE5/Main/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs //UE5/Main/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs ... #8 change 25985206 integrate on 2023/06/14 by chris.constantinescu@ROBOMERGE_FN_ENGINEMERGE_UE5_Main (text) 'Allow plugins "Tests" folder th' ... ... branch into //UE5/Dev-Cooker/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-NaniteResearch/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-NiagaraStateless/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#7 ... ... branch into //UE5/Dev-Release-5.5/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Release-5.3/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Release-5.4/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... #7 change 24824452 edit on 2023/03/28 by bryan.sefcik@bryan.sefcik_RDU-WD-L1148_UE5_Main (text) 'Updated finding rule files to b' ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#6 ... ... copy into //UE5/Dev-Subobjects/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#3 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#7 ... ... copy into //UE5/Release-Engine-Staging/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#9 ... #6 change 24465656 edit on 2023/03/01 by [Content removed].ue5 (text) 'EpicGames.Build: Don't throw an' ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#5 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#6 ... ... copy into //UE5/Release-Engine-Staging/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#8 ... #5 change 21392503 integrate on 2022/08/15 by henrik.karlsson@ROBOMERGE_UE5_UE5_Main (text) '[UBT/EpicGames.Build] * Removed' ... ... copy into //UE5/Dev-CollabHub/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#4 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#5 ... ... copy from //UE5/Release-Engine-Staging/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#7 ... #4 change 21371637 integrate on 2022/08/13 by henrik.karlsson@ROBOMERGE_UE5_UE5_Main (text) '[UnrealBuildTool] * Added suppo' ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#3 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#4 ... ... copy from //UE5/Release-Engine-Staging/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#6 ... #3 change 19792014 edit on 2022/04/18 by [Content removed]-YEG-0094-Main (text) 'Adjustments to the script modul' ... ... branch into //UE5/Dev-CollabHub/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... copy into //UE5/Dev-Iteration/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... ... copy into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#3 ... ... copy into //UE5/Release-Engine-Staging/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#5 ... #2 change 18242679 integrate on 2021/11/18 by Marc.Audy@Marc.Audy_UE5 (text) 'Merge Release-Engine-Test @ 182' ... ... branch into //UE5/Dev-Iteration/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-ParallelRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... copy into //UE5/Dev-Subobjects/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... ... copy into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... ... copy from //UE5/Release-Engine-Test/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#2 ... #1 change 17116964 move/add on 2021/08/10 by jonathan.adamczewski@jonathan.adamczewski_RDU-WD-F00126_6857 (text) 'Move DotNETCommon/BuildUtilitie' ... ... branch into //UE5/Dev-LargeWorldCoordinates/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-LWCRendering/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-Subobjects/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Dev-TensorWorks/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... moved from //UE5/Main/Engine/Source/Programs/DotNETCommon/BuildUtilities/System/Rules.cs#1 ... ... copy into //UE5/Release-Engine-Test/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 //UE5/Main/Engine/Source/Programs/DotNETCommon/BuildUtilities/System/Rules.cs ... #1 change 17102399 add on 2021/08/09 by jonathan.adamczewski@jonathan.adamczewski_RDU-WD-F00126_6857 (text) 'AutomationTool: Compile script ' ... ... moved into //UE5/Main/Engine/Source/Programs/Shared/EpicGames.Build/System/Rules.cs#1 ... ... branch into //UE5/Release-Engine-Test/Engine/Source/Programs/DotNETCommon/BuildUtilities/System/Rules.cs#1
I did a bit further investigation, no idea why but the workspace I used to check the above didn’t show anything beyond #8 in the depot. Using a different workspace however did show the newer versions…
This extended to the revision graph and everything. Suspect it is filtering to some kind of stream view somewhere. False alarm! Apologies.