The ros_buildfarm first builds a workspace, then builds the tests and runs the tests.
Since catkin_make_isolated is used which just passes make targets It relies on the CMake packages to have a tests target to build tests as well as a run_tests target to run the tests. For a plain CMake package you need to make sure to create these targets and make sure run_tests actually runs the tests. As you have already experienced implementing a similar logic as provided by catkin to run tests is not straight forward.
A modified version of the ros_buildfarm (https://github.com/ros-infrastructure/ros_buildfarm/pull/548) used for ROS 2 uses colcon instead of catkin_make_isolated for build the workspace and running the tests. The "big" difference is that it doesn't rely on a specific custom target to exist but runs the tests by invoking ctest instead. That would immediately work for plain CMake package which use CTest. It is unclear though at the moment when or even if the buildfarm for ROS 1 will switch to use this new build tool.
Maybe you can create a run_tests target in your CMake package which just invokes ctest (just speculating here - haven't tried it)?