All Apps and Add-ons

How to determine if a test case in jenkins build exists OR search for a specific key word in file?

cdgill
Explorer

If have this following tag in my search which returns whether a build has achieved the build stage. event_tag=job_event (type=started OR type=completed) "stages{}.name"=Build

I am now trying to search for if within this build stage I can determine whether test cases are present? Our test cases usually reside in the build stage(though sometimes make up their own 'test' stage) so my current search tag isn't enough. Is it possible to scan a file for a keyword such as junit to see if such test cases exist?

I should mention the purpose of this is to determine which builds don't have test cases, which tends to slow down or mess up our pipeline.

Thank you.

0 Karma

txiao_splunk
Splunk Employee
Splunk Employee
  • search for builds don't have test cases
    index=jenkins_statistics "test_summary.total"=0

  • search for test case keyword
    index=jenkins "keyword" | `expand_testcase`

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...