From c493de6569b7c9d3d02fce6780d0095e562999a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 24 Aug 2016 21:44:22 +0300 Subject: [PATCH] Try to output JS test results in jUnit format for CircleCI --- RoboFile.php | 15 ++++++++++++--- circle.yml | 15 ++------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 9209019461..94f8e1f185 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -119,14 +119,23 @@ class RoboFile extends \Robo\Tasks { ))); } - function testJavascript() { + function testJavascript($xml_output_file = null) { $this->compileJs(); - $this->_exec(join(' ', array( + $command = join(' ', array( './node_modules/.bin/mocha', '-r tests/javascript/mochaTestHelper.js', 'tests/javascript/testBundles/**/*.js' - ))); + )); + + if(!empty($xml_output_file)) { + $command .= sprintf( + ' --reporter xunit --reporter-options output="%s"', + $xml_output_file + ); + } + + $this->_exec($command); } function testDebug() { diff --git a/circle.yml b/circle.yml index 336c86548d..d884303138 100644 --- a/circle.yml +++ b/circle.yml @@ -1,15 +1,3 @@ -## Customize the test machine -machine: - timezone: - America/New_York # Set the timezone - - php: - version: - 5.6.5 - - services: - - mysql - ## Customize dependencies dependencies: pre: @@ -19,4 +7,5 @@ dependencies: ## tests override test: override: - - ./do t:j + - mkdir $CIRCLE_TEST_REPORTS/mocha + - ./do t:j $CIRCLE_TEST_REPORTS/mocha/junit.xml