Some validation should be done before attempting to upload a test. Check the user role and the test definition fields.