All Apps and Add-ons
Highlighted

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

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
Highlighted

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

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