Functional tests prevent the game from packaging

I am currently writing a simple automatic testing framework for a project and I need to be able to run a functional test battery from outside the editor (command line).

So here’s my problem: The functional tests (blueprint FunctionalTest) need to be in the home level to be able to run properly, but packaging with tests inside a level will make the game crash once it is compiled (since the tests blueprints will not be included).

Here are the solution I have tried:

  1. Dynamically adding the tests and launching them from the level blueprint.

  2. Adding the tests to a sub-level

  3. Implementing a custom command to add a test to the persistent level and sending this command as a parameter when launching the tests.

Alas none of them worked quite properly. I would like to know what is the proper way of adding test to a project.

LogStreaming:Error: Couldn’t find file for package /Game/Tests/FTEST_CheckEveryObjectiveTree requested by async loading code. NameToLoad: /Game/Tests/FTEST_CheckEveryObjectiveTree