Draft: fix failing pipeline
Summary
The pipeline was failing due to insufficient test coverage in the rspec:undercoverage job. Two error handling rescue blocks in the Duo Workflows services were not covered by tests:
- Line 54 in
ee/app/services/ai/duo_workflows/create_workflow_service.rb - Line 129 in
ee/app/services/ai/duo_workflows/update_workflow_status_service.rb
Changes
-
ee/spec/services/ai/duo_workflows/create_workflow_service_spec.rb
- Added new context
'when audit event creation fails'with 2 test cases - Tests verify
Gitlab::ErrorTracking.track_exceptionis called with correct error andworkflow_id - Ensures workflow creation continues successfully despite audit event failure (graceful degradation)
- Added new context
-
ee/spec/services/ai/duo_workflows/update_workflow_status_service_spec.rb
- Added 4 new contexts for different status events (start, finish, drop, stop)
- Added 4 test cases covering error handling when
::Gitlab::Audit::Auditor.auditraises an exception - Each test verifies
Gitlab::ErrorTracking.track_exceptionis called with correct parameters - Each test ensures workflow status update continues successfully
Verification
The rspec:undercoverage job should now pass as both methods will have coverage above the required threshold.
Edited by Duo Fix CI/CD Pipeline