[tests] Raise an exception if test definition is invalid (Found in #2460)