This isn't perfect, but it works okay. Unfortunately, some aspects of karma can't be configured from the command line (they have to be specified in the configuration file, which is JavaScript) which means that this test engine will probably not work unless the project has its Karma configuration file configured properly.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers
Cloned https://github.com/pc035860/angular-easyfb.git and setup a basic .arcconfig. Ran arc unit.
Diff Detail
- Repository
- rARC Arcanist
- Branch
- karma
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 1825 Build 1826: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
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.
src/unit/engine/KarmaTestEngine.php | ||
---|---|---|
67 | 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. We use $working_copy = $this->getWorkingCopy(); $project_root = $working_copy->getProjectRoot(); $parser = new ArcanistXUnitTestResultParser(); return $parser->parseTestResults(Filesystem::readFile($project_root . '/' . $junit)); |
src/unit/engine/KarmaTestEngine.php | ||
---|---|---|
60–61 | 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. |
Can you explain why ? I was about to write a karma / mocha UnitTestEngine and request a review in the upstream thus I'm interrested in understanding why upstream don't need this !