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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...