Simplify and reduce Capybara specs test coverage for Duo Chat
What does this MR do and Why
It removes Duo Chat Capybara specs coverage that was migrated to MSW Jest specs in the MR series listed below and other specs that I identified as redundant. It also moves all Duo Chat feature specs to the ee/spec/features/duo_chat directory for better discoverability. Duo Chat shared specs were included in many feature specs across the application to test Duo Chat in different contexts. However, the behavior tested by the specs didn't change across contexts. As explained below, this testing strategy has created significant pipeline flakyness with little value in return.
This Merge Request removes these shared examples and creates a single agentic_chat_smoke_spec.rb suite that covers functionality that is not easy to cover with MSW integration specs.
Why?
Duo Agentic Chat feature specs have been among the worst flakiness offenders in CI:
- https://gitlab.com/gitlab-org/quality/test-failure-issues/-/work_items/43218 —
user_sees_approval_widget_spec.rb, 28 pipelines blocked / 33 job failures in 14 days - https://gitlab.com/gitlab-org/quality/test-failure-issues/-/work_items/42787 —
blob_file_name_spec.rb, 38 pipelines blocked / 40 job failures, dominant errorexpected to find text "workflow retried" - https://gitlab.com/gitlab-org/quality/test-failure-issues/-/work_items/43257
- https://gitlab.com/gitlab-org/quality/test-failure-issues/-/work_items/43262
Migrating UI-focused capybara specs to MSW integration tests reduces pipeline duration and mitigates flakyness. Removing redundant tests make maintenance easier.
Verification
bundle exec rubocopis clean on the 10 remaining Ruby files the MR touches.bundle exec rspec --dry-runacross the 8 specs the MR changes, plus the two other consumers of the extracted shared context, gives 67 examples, 0 failures, 1 pending — which is what confirms no shared example or context is left dangling.- A
grepfor all five deleted shared-example names returns nothing anywhere inee/orspec/. - The four examples in
agentic_chat_smoke_spec.rbwere not run locally: they need a live duo-workflow-service, which:duo_workflow_servicestarts. CI is the first place they run in full. - The permission gates behind those four were checked separately instead, with a throwaway spec asserting the abilities under the migrated setup:
summarize_comments,troubleshoot_job_with_aiand the explain-code availability helper all come out true, matching the setups the examples came from. jest-msw-integrationdoes not run for this MR: its CI rule matches onlyspec/frontend/msw_integration/**, and this MR is Ruby-only.
The MR series
| # | MR | What it does | Status |
|---|---|---|---|
| 1 | !248777 (merged) | Sets up MSW test foundations | Merged |
| 2 | !248782 (merged) | Covers the AI panel shell | Merged |
| 3 | !248783 (merged) | Covers the chat conversation lifecycle | Merged |
| 4 | !248785 (merged) | Covers chat tool calls | Merged |
| 5 | !248787 (merged) | Covers agent and model selection | Merged |
| 6 | !248791 (merged) | Covers additional context | Merged |
| 7 | !244590 (merged) | Removes the replaced Capybara specs | This MR, merges last |
Related issue: Make Duo Agentic Chat feature specs more stable (#603605 - closed)