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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...