I'm not sure whether we want this in the upstream yet. I'm putting it here so that a colleague can arc patch it. I think that the unit test engine code needs some cleaning up before we add new engines.
Just in case you want to ever revisit this again, this will read file that is relative to the current working directory instead of the project root directory, and arc diff/unit would only be run-able in the project root directory.
$working_copy = $this->getWorkingCopy(); $project_root = $working_copy->getProjectRoot(); $parser = new ArcanistXUnitTestResultParser(); return $parser->parseTestResults(Filesystem::readFile($project_root . '/' . $junit));
Another note here. Unless I missed something, to run karma in non watch mode, --single-run option will be needed. However, in the single run mode karma will exit with code 1 when the test fails.
This will cause arc to not parse the test result, and since the reporters on karma's option here is only coverage and junit, there will be no test result outputted by karma either, leaving no information about why arc unit / arc diff failed.