Skip to content

Fix backend API test errors #143

Description

@frankbria

The following API tests are failing with the following information:

FAILED tests/api/test_api_discovery_progress.py::TestDiscoveryProgressEndpoint::test_get_discovery_progress_returns_null_when_discovery_not_started - assert 403 == 200
FAILED tests/api/test_api_discovery_progress.py::TestDiscoveryProgressEndpoint::test_get_discovery_progress_returns_progress_when_discovering - assert 403 == 200
FAILED tests/api/test_api_discovery_progress.py::TestDiscoveryProgressEndpoint::test_get_discovery_progress_returns_100_percent_when_completed - assert 403 == 200
FAILED tests/api/test_api_discovery_progress.py::TestDiscoveryProgressEndpoint::test_get_discovery_progress_matches_project_phase - assert 403 == 200
FAILED tests/api/test_api_discovery_progress.py::TestDiscoveryProgressEndpoint::test_get_discovery_progress_excludes_answers_field - assert 403 == 200
FAILED tests/api/test_api_issues.py::TestIssuesEndpointBasics::test_issues_endpoint_returns_200 - assert 403 == 200
FAILED tests/api/test_api_issues.py::TestIssuesResponseStructure::test_issues_response_has_required_fields - AssertionError: assert 'issues' in {'detail': 'Access denied'}
FAILED tests/api/test_api_issues.py::TestIssuesResponseStructure::test_issues_response_contains_issues_array - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesResponseStructure::test_issues_response_total_counts - KeyError: 'total_issues'
FAILED tests/api/test_api_issues.py::TestIssueStructure::test_issue_has_required_fields - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssueStructure::test_issue_id_is_string - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssueStructure::test_issue_depends_on_is_array - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssueStructure::test_issue_proposed_by_is_valid - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssueStructure::test_issue_timestamps_are_rfc3339 - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesWithTasks::test_issues_include_tasks_query_param - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesWithTasks::test_issue_tasks_is_array - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesWithTasks::test_issue_tasks_count - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestTaskStructure::test_task_has_required_fields - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestTaskStructure::test_task_id_is_string - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestTaskStructure::test_task_depends_on_is_array - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesEndpointEdgeCases::test_issues_without_tasks_query_param - KeyError: 'issues'
FAILED tests/api/test_api_issues.py::TestIssuesEndpointEdgeCases::test_empty_issues_list - KeyError: 'issues'
FAILED tests/api/test_api_metrics.py::TestProjectTokenMetricsEndpoint::test_endpoint_exists - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestProjectTokenMetricsEndpoint::test_returns_all_usage_records - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestProjectTokenMetricsEndpoint::test_date_filtering - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestProjectTokenMetricsEndpoint::test_invalid_date_format_returns_400 - assert 403 == 400
FAILED tests/api/test_api_metrics.py::TestProjectCostMetricsEndpoint::test_endpoint_exists - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestProjectCostMetricsEndpoint::test_returns_cost_breakdown - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestAgentMetricsEndpoint::test_returns_agent_metrics - assert 0 == 2
FAILED tests/api/test_api_metrics.py::TestAgentMetricsEndpoint::test_project_filtering - assert 403 == 200
FAILED tests/api/test_api_metrics.py::TestAgentMetricsEndpoint::test_agent_with_no_data_for_project_returns_empty - assert 404 == 200
FAILED tests/api/test_api_metrics.py::TestMetricsEndpointIntegration::test_all_endpoints_consistent - KeyError: 'total_calls'
FAILED tests/api/test_api_prd.py::TestPRDEndpointBasics::test_prd_endpoint_returns_200_when_available - assert 403 == 200
FAILED tests/api/test_api_prd.py::TestPRDResponseStructure::test_prd_response_has_required_fields - AssertionError: assert 'project_id' in {'detail': 'Access denied'}
FAILED tests/api/test_api_prd.py::TestPRDResponseStructure::test_prd_response_project_id_is_string - KeyError: 'project_id'
FAILED tests/api/test_api_prd.py::TestPRDResponseStructure::test_prd_response_timestamps_are_rfc3339 - KeyError: 'generated_at'
FAILED tests/api/test_api_prd.py::TestPRDResponseStructure::test_prd_response_status_is_available - KeyError: 'status'
FAILED tests/api/test_api_prd.py::TestPRDResponseStructure::test_prd_response_contains_correct_content - KeyError: 'prd_content'
FAILED tests/api/test_api_prd.py::TestPRDEndpointNotFound::test_prd_not_found_returns_status_not_found - assert 403 == 200
FAILED tests/api/test_api_prd.py::TestPRDEndpointNotFound::test_prd_not_found_returns_empty_content - KeyError: 'prd_content'
FAILED tests/api/test_api_prd.py::TestPRDEndpointEdgeCases::test_prd_endpoint_with_very_large_content - assert 403 == 200
FAILED tests/api/test_api_prd.py::TestPRDEndpointEdgeCases::test_prd_updated_at_reflects_latest_change - KeyError: 'updated_at'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_get_session_success_with_existing_session - assert 403 == 200
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_get_session_returns_empty_state_when_no_file - assert 403 == 200
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_state_structure_validation - KeyError: 'last_session'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_handles_corrupted_json - assert 403 == 200
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_timestamp_format - KeyError: 'last_session'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_next_actions_order_preserved - KeyError: 'next_actions'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_blocker_structure - KeyError: 'active_blockers'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_progress_percentage_range - KeyError: 'progress_pct'
FAILED tests/api/test_api_session.py::TestSessionEndpoint::test_session_endpoint_response_time - assert 403 == 200
FAILED tests/api/test_api_session.py::TestSessionEndpointEdgeCases::test_session_with_empty_next_actions - KeyError: 'next_actions'
FAILED tests/api/test_api_session.py::TestSessionEndpointEdgeCases::test_session_with_zero_progress - KeyError: 'progress_pct'
FAILED tests/api/test_api_session.py::TestSessionEndpointEdgeCases::test_session_with_100_percent_progress - KeyError: 'progress_pct'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolveEndpointBasics::test_resolve_endpoint_returns_200_on_success - assert 403 == 200
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolveResponseStructure::test_resolve_response_has_required_fields - AssertionError: assert 'blocker_id' in {'detail': 'Access denied'}
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolveResponseStructure::test_resolve_response_blocker_id_is_int - KeyError: 'blocker_id'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolveResponseStructure::test_resolve_response_status_is_resolved - KeyError: 'status'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolveResponseStructure::test_resolve_response_timestamp_is_rfc3339 - KeyError: 'resolved_at'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionPersistence::test_blocker_status_updated_in_database - AssertionError: assert 'PENDING' == 'RESOLVED'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionPersistence::test_answer_stored_in_database - AssertionError: assert None == 'Use JWT for stateless API authentication'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionPersistence::test_resolved_at_timestamp_stored - assert None is not None
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionValidation::test_resolve_accepts_answer_at_max_length - assert 403 == 200
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionConflicts::test_duplicate_resolution_returns_409 - assert 403 == 200
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionConflicts::test_duplicate_resolution_preserves_first_answer - AssertionError: assert None == 'Answer 1'
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionConflicts::test_conflict_response_includes_blocker_id - AssertionError: assert 'blocker_id' in {'detail': 'Access denied'}
FAILED tests/api/test_blocker_resolution_api.py::TestBlockerResolutionConflicts::test_conflict_response_includes_error_message - AssertionError: assert 'error' in {'detail': 'Access denied'}
FAILED tests/api/test_chat_api.py::TestChatEndpoint::test_send_message_success - assert 403 == 200
FAILED tests/api/test_chat_api.py::TestChatEndpoint::test_send_message_agent_not_started - assert 403 == 400
FAILED tests/api/test_chat_api.py::TestChatEndpoint::test_send_message_agent_failure - assert 403 == 500
FAILED tests/api/test_chat_api.py::TestChatHistoryEndpoint::test_get_history_success - assert 403 == 200
FAILED tests/api/test_chat_api.py::TestChatHistoryEndpoint::test_get_history_pagination - assert 403 == 200
FAILED tests/api/test_chat_api.py::TestChatHistoryEndpoint::test_get_history_empty - assert 403 == 200
FAILED tests/api/test_chat_api.py::TestChatWebSocketIntegration::test_chat_broadcasts_message - assert 403 == 200
FAILED tests/api/test_chat_api.py::TestChatWebSocketIntegration::test_chat_continues_when_broadcast_fails - assert 403 == 200
FAILED tests/api/test_discovery_endpoints.py::TestDiscoveryAnswerEndpoint::test_post_discovery_answer_returns_200_with_valid_answer - assert 403 == 200
FAILED tests/api/test_discovery_endpoints.py::TestDiscoveryAnswerEndpoint::test_post_when_not_in_discovery_phase_returns_400 - assert 403 == 400
FAILED tests/api/test_discovery_endpoints.py::TestDiscoveryAnswerEndpoint::test_discovery_not_started_returns_400 - assert 403 == 400
FAILED tests/api/test_discovery_endpoints.py::TestDiscoveryAnswerEndpoint::test_lead_agent_process_discovery_answer_called_correctly - assert 403 == 200
FAILED tests/api/test_discovery_endpoints.py::TestDiscoveryAnswerEndpoint::test_response_includes_required_fields - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectsEndpoint::test_list_projects_with_data - assert 0 == 2
FAILED tests/api/test_endpoints_database.py::TestProjectsEndpoint::test_list_projects_returns_all_fields - IndexError: list index out of range
FAILED tests/api/test_endpoints_database.py::TestProjectStatusEndpoint::test_get_project_status_success - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectStatusEndpoint::test_get_project_status_returns_complete_data - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestAgentsEndpoint::test_get_agents_empty_list - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestAgentsEndpoint::test_get_agents_with_data - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestAgentsEndpoint::test_get_agents_returns_all_fields - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestEndpointDatabaseIntegration::test_complete_project_workflow_via_api - assert False
FAILED tests/api/test_endpoints_database.py::TestEndpointDatabaseIntegration::test_endpoints_survive_multiple_requests - assert False
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_empty_database - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_with_data - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_status_filtering - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_pagination - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_total_count_accuracy - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpoint::test_get_tasks_edge_cases - assert 403 == 200
FAILED tests/api/test_endpoints_database.py::TestProjectTasksEndpointSecurity::test_get_tasks_valid_max_limit_accepted - assert 403 == 200
FAILED tests/api/test_project_creation_api.py::TestProjectCreationIntegration::test_create_project_via_api_then_get_status - AttributeError: 'dict' object has no attribute 'id'
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_success - assert 403 == 200
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_with_severity_filter - assert 403 == 200
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_multiple_severity_filters - assert 403 == 200
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_empty_project - assert 403 == 200
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_findings_structure - assert 403 == 200
FAILED tests/api/test_project_reviews.py::TestProjectCodeReviewsEndpoint::test_get_project_code_reviews_no_blocking_issues - assert 403 == 200

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions