mocha-bamboo-reporter | Bamboo Reporter for Mocha on Node.js | Runtime Evironment library
kandi X-RAY | mocha-bamboo-reporter Summary
kandi X-RAY | mocha-bamboo-reporter Summary
Bamboo Reporter for Mocha on Node.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mocha-bamboo-reporter
mocha-bamboo-reporter Key Features
mocha-bamboo-reporter Examples and Code Snippets
Community Discussions
Trending Discussions on mocha-bamboo-reporter
QUESTION
I'm running mocha tests as part of a deployment process and need to use mocha test parser for bamboo to know what failed (using reporter mocha-bamboo-reporter). Mocha test parser task is only able to run during the build process (it can't be added as part of a deployment process). Is there a way to run it from a command, node.js or npm task?
Currently when tests fail bamboo is still saying that the deployment was ok. Test run configuration: config
...ANSWER
Answered 2019-Jul-16 at 16:08Typically you would only want to run your tests as part of the build process and not the deployment process. This is why you do not see these options as part of the deployment. Generally, Bamboo deployment failures are the result of files not copying, connection errors, or errors in scripts.
Because you are running tests in the deployment, the test runner will return "0" indicating that the task to execute the tests ran fine. Bamboo allows you to do this so that you can run tests as a deployment and still deploy.
Instead of failing the deploy, add two tasks to the build to run the tests and parse the results. If the tests pass you can have the deploy trigger on the success of the build. This gives you the following advantages that you are currently missing:
- Deployments only will start if tests pass.
- Bamboo has a nice summary page for tests and will provide useful metrics such as how many times a specific test has failed.
- It separates the deployment from the integration (i.e. build/test).
However, if you are dead set on running tests and parsing in a deployment, you could have a node.js, command, or script task that parses the results and then returns -1 (or a non-zero number) if tests failed.
QUESTION
I am trying to generate an nyc/istanbul coverage report on my project (using mocha). I can get this to run from the command line with the following command:
npm test --reporter mocha-bamboo-reporter test/
which is essentially running
nyc mocha --recursive "mocha-bamboo-reporter" "test/"
The tricky part is that I need to run this in bamboo which doesn't seem to support chaining of/multiple commands in one task.
My bamboo config has a mocha test runner:
node_modules/mocha/bin/mocha --reporter mocha-bamboo-reporter --recursive
I have an istanbul/nyc instrument task:
./node_modules/nyc/bin/nyc.js instrument test/ .nyc_output
And then a coverage report task:
./node_modules/nyc/bin/nyc.js report
When this runs I get no data in the report file:
...ANSWER
Answered 2018-May-30 at 19:47Figured this out. The best way to do it was to create a custom script within my package.json file and then call that from Bamboo.
package.json
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mocha-bamboo-reporter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page