1.0.7 • Published 2 years ago

mocha-splunk v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

mocha-splunk

This is a reporter for Mocha to log test results to Splunk.

Installation
To install run npm install mocha-splunk

Usage
This reporter will log below mentioned information to splunk 1. Test run number 2. Git branch 3. Test duration 4. Test title 5. Test result 6. Additional debug information To use this in your Mocha tests, update your run command to use Mocha-Splunk reporter as below: mocha --reporter mocha-splunk --reporter-options <options> testfiles.js

To use the reporter, below is list of reporter options that needs to be setup

OptionRequiredDescription
run_noNoTest run number / build number
test_envNoTest environment e.g. QA/UAT
git_branchNoGit branch under test
splunk_hostYesSplunk host name e.g. splunk.com:8088
splunk_urlNoURL for event collector e.g. /services/collector
splunk_tokenYesSplunk HTTP token
debugNoprint debug information from the reporter
useProcessVarNoWhether to read options from environment variables

Make sure to providing values mandatory options as outlined in above table to make sure smooth reporting on slack

Quering splunk
In the new search, mention your index and source type as http event. This will list your test results image

Note: This reporter is based on mochawesome. Many thanks to the maintainers.