Hi,
here is my requirement. Could you please advise , how far I can able to achieve using splunk plugin in Jenkins
Scenario: 10 jenkins Jobs with each job having 5 Tests each ( first job has TestNg, Second job has Extent test results and third job has robot framework test)
Prepare dash board with all 10 required jobs
• Pass Rate (PR)
o In 1 week if each job will be triggered once daily, each one will have run 25 Tests (5 Tests/job x 5 days)
o So, 10 Jobs x 25 Tests/job = 250 Tests triggered in 1 week
o Pass Rate (PR) = Total # of Passed/Total # of Tests
example: 235/250 (94%)
o Note that, we are reporting Tests not Builds!
• Average Run Time (ART)
o This refers to the average time required to run the full test suite.
o RTx = Average run time of each job [where x: 1,2,3,..10] computed as run time on each day divided by number of days [ (T1+T2+T3+T4+T5)/5 ]
o ART = RT1 + RT2 + RT3 + ... + RT10
• Total number of Tests triggered
o Total number of unique tests run. In this example, this will be 10 Jobs x 5 Tests/Job so 50 unique tests.
• Trend
o Pass Rate
To monitor the state of our test scripts on a weekly basis. Mainly for stability or early detection of issues.
o Average Run Time
To monitor if we can support the under 12 hours regression
o Test Suite Size (Total number of Tests triggered)
To monitor if we are adding more tests to the automation suite
Something like Build stats plugin, Global stat plugin - but not intuitive - to get JobLevel test case pass information to be viewed with.
Could you please help me here?
Regards,
LnT
You may need check out the Dashboards and Visualizations And Examples. All the data can be get using
index=jenkins_statistics event_tag=job_event type=completed
Sample dashboard
<dashboard>
<label>Test_Report</label>
<row>
<panel>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" sum(test_summary.total) as Total, sum(test_summary.passes) as Passed</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">line</option>
</chart>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" sum(test_summary.total) as Total, sum(test_summary.passes) as Passed| eval "Pass Rate"=100*(Passed/Total) |fields _time,"Pass Rate"
</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">line</option>
</chart>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" avg(test_summary.duration) as "Average Run Time"</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">area</option>
</chart>
</panel>
</row>
</dashboard>
Thank you so much to your reply.
Before get on to the dash board – I could not able to get any data fetches from Jenkins to Splunk.
Here are the configurations in my local.
1. Installed splunk version 6.4.5 in my local
2.
3. Installed splunk app for Jenkins
4. Installed spunk dashboard examples app
5. Installed splunk plugin in Jenkins . Please find below configurations.
a. Jenkins Manage Jenkins Configure
I don’t find anything to fill metadata information.
I see no results found in splunk.
Could you please help – Seems to be something is missed . could you show me some light
screenshots are attached
not able to attach the screenshots. due to less karma points.
I see the Splunk connection verified in Jenkins configuration.
Seems to be meta data information - to be revisited - No idea what to be added in.
source=jenkins
index=jenkins_statistics
build_report.index=jenkins
file.index=jenkins_artifact
console_log.index=jenkins_console
the metadata is only needed for initial release 1.0
If you are using latest version, it is not needed. For more details, checkout wiki
You may need check out the Dashboards and Visualizations And Examples. All the data can be get using
index=jenkins_statistics event_tag=job_event type=completed
Sample dashboard
<dashboard>
<label>Test_Report</label>
<row>
<panel>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" sum(test_summary.total) as Total, sum(test_summary.passes) as Passed</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">line</option>
</chart>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" sum(test_summary.total) as Total, sum(test_summary.passes) as Passed| eval "Pass Rate"=100*(Passed/Total) |fields _time,"Pass Rate"
</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">line</option>
</chart>
<chart>
<search>
<query>index=jenkins_statistics event_tag=job_event type=completed |timechart span="1w" avg(test_summary.duration) as "Average Run Time"</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="charting.chart">area</option>
</chart>
</panel>
</row>
</dashboard>