Skip to content

Testing - Backend #78

@garotm

Description

@garotm

Current State

Files Changed

On branch feature/calendar-centric-ui
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   backend/functions/event_discovery/search.py
        modified:   backend/models/event.py
        modified:   backend/requirements.txt
        new file:   backend/tests/functions/test_search.py
        modified:   ios/RunOn/RunOn/Core/Models/Event.swift
        new file:   ios/RunOn/RunOn/Features/Events/CalendarView.swift
        modified:   ios/RunOn/RunOn/Features/Events/EventsView.swift
        modified:   ios/RunOn/RunOn/Features/Events/EventsViewModel.swift
        modified:   ios/RunOn/RunOn/Info.plist
        modified:   ios/RunOn/RunOnTests/EventsViewModelTests.swift
        modified:   ios/RunOn/RunOnTests/Helpers/TestHelpers.swift
        new file:   ios/RunOn/RunOnTests/Views/CalendarViewTests.swift
        modified:   ios/RunOn/RunOnUITests/RunOnUITests.swift

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   backend/functions/event_discovery/search.py
        modified:   backend/requirements.txt
        deleted:    backend/tests/event_discovery/test_search.py
        deleted:    backend/tests/functions/event_discovery/test_search.py
        modified:   backend/tests/functions/test_search.py
        modified:   ios/RunOn/RunOn/Core/Models/Event.swift
        modified:   ios/RunOn/RunOn/Features/Events/EventsView.swift
        modified:   ios/RunOn/RunOn/Features/Events/EventsViewModel.swift
        modified:   ios/RunOn/RunOnTests/EventsViewModelTests.swift
        modified:   ios/RunOn/RunOnTests/Helpers/TestHelpers.swift
        modified:   ios/RunOn/RunOnUITests/RunOnUITests.swift

Test output

---------- coverage: platform darwin, python 3.9.21-final-0 ----------
Name                                  Stmts   Miss  Cover   Missing
-------------------------------------------------------------------
config/environment.py                    12      0   100%
functions/auth/auth.py                   20      0   100%
functions/calendar_sync/calendar.py      46     12    74%   43-68
functions/event_discovery/search.py     119     27    77%   32-38, 57-59, 87-88, 115-119, 136-138, 143-145, 160, 202, 226-228
main.py                                  29      0   100%
models/event.py                          19      0   100%
-------------------------------------------------------------------
TOTAL                                   245     39    84%
Coverage XML written to file coverage.xml

Required test coverage of 80% reached. Total coverage: 84.08%
====================================================================== short test summary info =======================================================================
FAILED tests/calendar_sync/test_calendar.py::test_add_event_to_calendar_success - AssertionError: assert None == 'test123'
FAILED tests/calendar_sync/test_calendar.py::test_add_event_to_calendar_existing - ValueError: "Event" object has no field "calendar_event_id"
FAILED tests/calendar_sync/test_calendar.py::test_add_event_to_calendar_not_found - ValueError: "Event" object has no field "calendar_event_id"
FAILED tests/calendar_sync/test_calendar.py::test_add_event_to_calendar_http_error - ValueError: "Event" object has no field "calendar_event_id"
FAILED tests/functions/test_search.py::test_extract_date_various_formats - AttributeError: 'NoneType' object has no attribute 'date'
FAILED tests/functions/test_search.py::test_search_running_events - RuntimeError: generator raised StopIteration
FAILED tests/functions/test_search.py::test_search_error_handling - RuntimeError: generator raised StopIteration
FAILED tests/models/test_event.py::test_event_initialization - AttributeError: 'Event' object has no attribute 'calendar_event_id'
FAILED tests/models/test_event.py::test_event_initialization_minimal - AttributeError: 'Event' object has no attribute 'calendar_event_id'
FAILED tests/models/test_event.py::test_to_calendar_event_with_distance - AttributeError: 'Event' object has no attribute 'to_calendar_event'
FAILED tests/models/test_event.py::test_to_calendar_event_without_distance - AttributeError: 'Event' object has no attribute 'to_calendar_event'
FAILED tests/models/test_event.py::test_to_dict - KeyError: 'calendar_event_id'
FAILED tests/models/test_event.py::test_from_dict - AttributeError: from_dict
============================================================= 13 failed, 24 passed, 2 warnings in 1.59s ==============================================================

Effort Remaining

  1. Event Model Issues:

    • Missing calendar_event_id field (causing 4 test failures)
    • Missing to_calendar_event method (2 failures)
    • Missing from_dict class method (1 failure)
    • Incorrect to_dict implementation (not including calendar_event_id)
  2. Calendar Sync Issues:

    • test_add_event_to_calendar_success failing (returns None instead of 'test123')
    • Three other calendar sync failures due to missing calendar_event_id field
  3. Search Function Issues:

    • test_extract_date_various_formats failing with NoneType error
    • test_search_running_events failing with StopIteration
    • test_search_error_handling failing with StopIteration
  4. Main.py Issues:

    • All the test failures marked as ERRORS are actually failing because of the cascading effect from these core issues

When you return, we'll need to fix these in a logical order:

  1. First the Event model (as other failures depend on it)
  2. Then the search functionality
  3. Finally the calendar sync
  4. Verify all main.py tests pass

This should get us back to 100% coverage and all tests passing. Thank you for the correction on including the ERRORS in our assessment.

Ah yes, you're right - I should have been more precise. Looking at the full test failures, we have:

  1. Event Model Issues:

    • Missing calendar_event_id field (causing 4 test failures)
    • Missing to_calendar_event method (2 failures)
    • Missing from_dict class method (1 failure)
    • Incorrect to_dict implementation (not including calendar_event_id)
  2. Calendar Sync Issues:

    • test_add_event_to_calendar_success failing (returns None instead of 'test123')
    • Three other calendar sync failures due to missing calendar_event_id field
  3. Search Function Issues:

    • test_extract_date_various_formats failing with NoneType error
    • test_search_running_events failing with StopIteration
    • test_search_error_handling failing with StopIteration
  4. Main.py Issues:

    • All the test failures marked as ERRORS are actually failing because of the cascading effect from these core issues

When you return, we'll need to fix these in a logical order:

  1. First the Event model (as other failures depend on it)
  2. Then the search functionality
  3. Finally the calendar sync
  4. Verify all main.py tests pass

This should get us back to 100% coverage and all tests passing. Thank you for the correction on including the ERRORS in our assessment.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions