test(orbit): cover context and grep service gaps

What does this MR do and why?

Adds specs for the Orbit context and grep services that rspec:undercoverage flagged on the parent MR. No app code changes. The parent author asked for this as a follow-up.

References

How to set up and validate locally

bundle exec rspec ee/spec/services/analytics/orbit/{context_service,context_llm_formatter,grep_service}_spec.rb

MR acceptance checklist

Evaluated against the MR acceptance checklist. Specs only.

Agent context

New examples:

  • context_service_spec.rb: branch and commit lookup return not found when the repository raises NoRepository or CommandError; branch without a pipeline; branch whose target cannot be resolved; commit with a nil authored date; commit without read_commit_diff; diff overflow marks changed files as cut; job with allow_failure; job without a stage; pipeline without a project; query count stays flat as the pipeline gets more jobs (warm-up, unfiltered control, exceed_query_limit; it fails with the job preload removed).
  • context_llm_formatter_spec.rb: a job with no stage or failure flags.
  • grep_service_spec.rb: branch search keeps non-letter, non-glob characters.

Ran the three spec files with SIMPLECOV=1: 144 examples, 0 failures. Branch coverage (lcov BRDA) of the flagged spots, both branches taken: context_service.rb 184 (121/1), 282 (5/1), 308 (10/1), 424 (10/1), 495 (15/1); context_llm_formatter.rb 131 (1/1); grep_service.rb 193 (1/1). The find_branch and find_commit rescue lines are executed.

CI: [skip ci] skips the MR pipeline only.

from agent

Edited by Dmitry Gruzd

Merge request reports

Loading
Loading