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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...