Fix Test errors
Failures in automated test lifecycle management, test execution tracking, and test maintenance workflows.
Common error signatures
FileNotFoundError: Coverage file not found: {path}— The coverage.xml file specified intrack_coverage()doesn't existValueError: Invalid coverage.xml format: {details}— Coverage file exists but contains malformed XML or missing required elements- Test task queue corruption causing
TestTaskprocessing failures - File path resolution errors when mapping source files to their corresponding test files
- Priority filtering failures in
TestLifecycleManager.process_queue()
Where errors originate
Most failures occur during:
- Test execution tracking —
run_tests_with_tracking()fails when test commands exit with non-zero codes or produce unparseable output - Coverage analysis —
track_coverage()raises exceptions when coverage files are missing, corrupted, or in unexpected formats - File monitoring — Event handlers (
on_file_created(),on_file_modified(),on_file_deleted()) fail when file paths are invalid or inaccessible - Queue processing —
TestLifecycleManager.process_queue()encounters errors when tasks reference deleted files or have malformed metadata - Test maintenance planning —
TestMaintenanceWorkflow.run()fails when project structure analysis produces inconsistent results
How to diagnose
-
Check file paths first. Many errors stem from missing test files, moved source files, or incorrect project root configuration. Verify that
project_rootinTestMaintenanceWorkflowandTestLifecycleManagerpoints to the correct directory. -
Examine the task queue. If
TestLifecycleManageroperations fail, callget_queue()to inspect pending tasks. Look for tasks with invalidfile_pathvalues or corruptedmetadatafields. -
Validate coverage files. When
track_coverage()fails, check that the coverage.xml file exists and contains valid XML. The file must include<coverage>root elements with measurable line and branch data. -
Test file mapping issues. If test lifecycle events fail, verify that the
ProjectIndexcan correctly map source files to test files. Missing or outdated index data causes most file-based operations to fail. -
Check priority and action values.
TestPlanItemandTestTaskobjects require validTestActionandTestPriorityenum values. Invalid enums cause filtering and processing methods to raiseAttributeErrororKeyError.
Source files
src/attune/workflows/test_runner.pysrc/attune/workflows/test_maintenance.pysrc/attune/workflows/test_lifecycle.py
Tags: tests, debugging, fixes