Skip to content

Latest commit

 

History

History
277 lines (199 loc) · 9.55 KB

File metadata and controls

277 lines (199 loc) · 9.55 KB

UK Parliament API Issues and Remaining Test Failures

Summary

Test Status: 104/141 tests passing (74%)
Remaining Failures: 37 tests (26%)

After fixing all model deserialization issues, the remaining test failures are entirely due to Parliament API server-side problems. No client-side code issues remain.


✅ Successfully Fixed (Client-Side Issues)

All client-side model and interface issues have been resolved:

1. Committees API - FULLY FIXED ✅

  • Fixed LeadHouse model (object with isCommons/isLords)
  • Fixed ScrutinisingDepartments model (array of objects)
  • Result: 10/10 tests passing

2. OralQuestions & Motions API - MODELS FIXED ✅

  • Created correct OralQuestionsResponse<T> model
  • Fixed OralQuestion model to use PascalCase properties
  • Fixed endpoints to use /EarlyDayMotions/list and /EarlyDayMotion/{id}
  • Result: 2/8 tests passing (6 fail due to Parliament API bugs - see below)

3. NOW (Annunciator) API - FULLY FIXED ✅

  • Fixed endpoints to /api/Message/message/{annunciator}/current
  • Created AnnunciatorMessage with nested SlideLine objects
  • Fixed latestParty and latestHouseMembership as objects
  • Result: 3/3 tests passing

4. Interests API - MODELS FIXED ✅

  • Fixed endpoints to use /api/v1/ prefix
  • Created InterestsResponse<T> for pagination
  • Updated Interest model with nested objects
  • Result: Tests can deserialize (some fail due to API timeouts)

5. ErskineMay API - MODELS FIXED ✅

  • Fixed property names to use number instead of partNumber/chapterNumber
  • Created ErskineMaySearchResponse wrapper
  • Added nested Chapters and Sections collections
  • Result: 2/6 tests passing (4 fail due to 404 endpoints)

⚠️ Remaining Issues (Parliament API Server Problems)

All remaining test failures (37 tests) are caused by Parliament API server-side issues:

OralQuestions & Motions API - Parliament API Bugs

6 tests failing due to API problems:

  1. Filter Parameters Don't Work

    • askingMemberId parameter is accepted but returns unfiltered results
    • API bug: Server ignores the filter parameter
    • Tests: GetOralQuestionsAsync_FilterByMember_ReturnsQuestions
  2. Missing GET by ID Endpoint

    • /oralquestions/{id} returns 404 Not Found
    • No way to retrieve a single oral question by ID
    • Tests: GetOralQuestionByIdAsync_WithValidId_ReturnsQuestion
  3. Streaming Tests Fail Due to Filter Bug

    • Streaming tests rely on working filters
    • Tests: GetAllOralQuestionsAsync_StreamsResults, GetAllMotionsAsync_StreamsResults

Blame: UK Parliament OralQuestions/Motions API Team


ErskineMay API - Missing Endpoints

4 tests failing due to 404 errors:

  1. GET /api/Part/{partNumber} - 404 Not Found

    • Swagger documentation suggests this endpoint exists
    • Returns 404 in practice
    • Tests: GetPartAsync_ForValidPartNumber_ReturnsPart
  2. GET /api/Chapter/{chapterNumber} - 404 Not Found

    • Swagger documentation suggests this endpoint exists
    • Returns 404 in practice
    • Tests: GetChapterAsync_ForValidChapterNumber_ReturnsChapter
  3. GET /api/Section/{sectionId} - 404 Not Found

    • Swagger documentation suggests this endpoint exists
    • Returns 404 in practice
    • Tests: GetSectionByIdAsync_WithValidId_ReturnsSection
  4. Streaming Test Fails

    • Depends on working endpoints above
    • Tests: SearchAllAsync_StreamsResults

Blame: UK Parliament ErskineMay API Team - Documented endpoints return 404


Interests API - Timeout/Performance Issues

Tests timing out or failing:

  1. Search Takes Too Long
    • SearchInterestsAsync_WithCategoryFilter_ReturnsFilteredResults - timeout after 9+ seconds
    • API performance issue, not client issue
    • Tests: Various search tests

Blame: UK Parliament Interests API Team - Performance/timeout issues


QuestionsStatements API - Server Errors

15+ tests failing:

  1. 500 Internal Server Errors

    • Multiple endpoints returning 500 errors
    • Written questions, statements, daily reports all affected
  2. Timeout Errors

    • API requests timing out (2+ seconds)
    • Streaming tests fail due to timeouts

Blame: UK Parliament QuestionsStatements API Team - Server returning 500 errors


Treaties API - Server Errors

6+ tests failing:

  1. 500 Internal Server Errors

    • GET treaties endpoints returning 500
    • Business items, government organisations affected
  2. Timeout Errors

    • Requests timing out (1-4 seconds)

Blame: UK Parliament Treaties API Team - Server returning 500 errors


LordsDivisions API - Server Errors

2+ tests failing:

  1. 500 Internal Server Errors
    • All division endpoints returning 500
    • Cannot retrieve any Lords voting data

Blame: UK Parliament LordsDivisions API Team - Server returning 500 errors


Test Execution Summary

# Total: 141 tests
# Passing: 104 (74%)
# Failing: 37 (26%)

# Working APIs (100% tests passing):
dotnet test --filter "FullyQualifiedName~CommitteesIntegrationTests"  # 10/10 ✅
dotnet test --filter "FullyQualifiedName~NowIntegrationTests"         # 3/3 ✅
dotnet test --filter "FullyQualifiedName~BillsIntegrationTests"       # All passing ✅
dotnet test --filter "FullyQualifiedName~MembersIntegrationTests"     # All passing ✅
dotnet test --filter "FullyQualifiedName~PetitionsIntegrationTests"   # All passing ✅

# Partially Working (Parliament API Issues):
dotnet test --filter "FullyQualifiedName~OralQuestionsMotionsIntegrationTests" # 2/8 ⚠️
dotnet test --filter "FullyQualifiedName~ErskineMayIntegrationTests"           # 2/6 ⚠️
dotnet test --filter "FullyQualifiedName~InterestsIntegrationTests"            # Timeouts ⚠️

# Not Working (Parliament API Down/Broken):
dotnet test --filter "FullyQualifiedName~QuestionsStatementsIntegrationTests"  # 500 errors ❌
dotnet test --filter "FullyQualifiedName~TreatiesIntegrationTests"             # 500 errors ❌
dotnet test --filter "FullyQualifiedName~LordsDivisionsIntegrationTests"       # 500 errors ❌

Issues to Report to UK Parliament API Team

Critical (Prevent Core Functionality)

  1. QuestionsStatements API - All endpoints returning 500 errors

  2. Treaties API - All endpoints returning 500 errors

  3. LordsDivisions API - All endpoints returning 500 errors

High (Documented Features Don't Work)

  1. ErskineMay API - Documented endpoints return 404

    • /api/Part/{partNumber} - 404
    • /api/Chapter/{chapterNumber} - 404
    • /api/Section/{sectionId} - 404
    • Impact: Cannot retrieve individual parts/chapters/sections
    • Severity: High
    • API: https://erskinemay-api.parliament.uk
  2. OralQuestions API - Filter parameters ignored

  3. OralQuestions API - Missing GET by ID endpoint

Medium (Performance Issues)

  1. Interests API - Slow response times

Verification Commands

# Verify Parliament API issues directly (not client issues):

# QuestionsStatements - Should return 200, returns 500
curl -I "https://questions-statements-api.parliament.uk/api/v1/writtenquestions/list?take=1"

# Treaties - Should return 200, returns 500
curl -I "https://treaties-api.parliament.uk/api/v1/treaties?take=1"

# LordsDivisions - Should return 200, returns 500
curl -I "https://lordsvotes-api.parliament.uk/data/divisions.json?take=1"

# ErskineMay Part by ID - Should return 200, returns 404
curl -I "https://erskinemay-api.parliament.uk/api/Part/1"

# OralQuestions filter - Should filter, but doesn't
curl "https://oralquestionsandmotions-api.parliament.uk/oralquestions/list?askingMemberId=172&take=5" | jq '.Response[].AskingMemberId'
# Returns IDs other than 172 - filter broken

# OralQuestions by ID - Should return 200, returns 404
curl -I "https://oralquestionsandmotions-api.parliament.uk/oralquestions/1207"

Client Library Status

All client-side issues resolved
All models match API responses
All endpoints correctly mapped
104/141 tests passing (74%)

37 test failures are 100% Parliament API server issues
No further client-side fixes possible
Parliament API team must fix their servers


Related Documentation