Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Incremental progress on fixing skipped tests and cleaning up type errors using parallel subagent approach.

Integration Tests Fixed (3 tests) ✅

test_self_service_signup.py (13 tests passing)

  • Fixed OAuth mocking with proper Flask app context
  • Uses patch.object(app, "oauth") instead of complex mocking
  • Verifies complete signup flow with session management

test_workflow_lifecycle.py (7 tests passing)

  • Added missing integration_db fixture dependency
  • Changed @pytest.mark.skip_ci to @pytest.mark.requires_db

test_mcp_tool_roundtrip_minimal.py (9/13 tests passing)

  • Fixed to use mcp_server fixture instead of manual server
  • Bonus fix: Updated mcp_server fixture to use PostgreSQL (was using SQLite, violating PostgreSQL-only architecture)
  • Fixed test fixtures with correct Product schema
  • Fixed response parsing to use FastMCP's structured_content

mypy Type Errors Fixed (~330 errors, 22% reduction) 🎯

Core Schemas (100% clean ✨)

  • schemas.py: 43 → 0 errors
  • Fixed Field() validation constraints (ge/le instead of minimum/maximum)
  • Fixed Pydantic v2 Field examples parameter
  • Fixed function parameter type hints

Core Tools (~90 errors fixed)

  • creatives.py: 203 → 115 errors (43% reduction)
  • media_buy_update.py: 118 → 107 errors (9% reduction)
  • Fixed missing optional fields in constructors
  • Fixed Literal type annotations

Adapters (mock_ad_server 100% clean! ✨)

  • mock_ad_server.py: 26 → 0 errors (100% fixed!)
  • kevel.py: 47 → 23 errors (51% reduction)
  • triton_digital.py: 52 → 31 errors (40% reduction)

Core Infrastructure

  • main.py: 64 → 16 errors (75% reduction)

Test Results 🧪

  • ✅ Unit tests: 906 passed
  • ✅ Integration tests: 96 passed
  • ✅ Integration V2 tests: 120 passed
  • ✅ E2E tests: 28 passed (3 failed due to port conflicts only - not code issues)

Approach

Used parallel subagents to tackle both objectives simultaneously:

  • Python expert agents fixed test issues independently
  • Type cleanup agents focused on high-error files
  • All changes maintain backward compatibility

Next Steps

  • 4 product pricing tests still need work (agent in progress)
  • 4 GAM tests skipped (separate PR already exists)
  • ~1140 mypy errors remaining (can tackle in future PRs)

This PR represents solid incremental progress toward both goals while keeping changes manageable for review.

This is incremental progress on fixing skipped tests and cleaning up type errors.

## Integration Tests Fixed (3 tests)

✅ **test_self_service_signup.py** (13 tests passing)
- Fixed OAuth mocking with proper Flask app context
- Uses `patch.object(app, "oauth")` instead of complex mocking
- Verifies complete signup flow with session management

✅ **test_workflow_lifecycle.py** (7 tests passing)
- Added missing `integration_db` fixture dependency
- Changed `@pytest.mark.skip_ci` to `@pytest.mark.requires_db`

✅ **test_mcp_tool_roundtrip_minimal.py** (9/13 tests passing)
- Fixed to use `mcp_server` fixture instead of manual server
- Updated `mcp_server` fixture to use PostgreSQL (fixes architecture violation)
- Fixed test fixtures with correct Product schema
- Fixed response parsing to use FastMCP's `structured_content`

## mypy Type Errors Fixed (~330 errors, 22% reduction)

**Core Schemas (100% clean):**
- schemas.py: 43 → 0 errors
- Fixed Field() validation constraints (ge/le instead of minimum/maximum)
- Fixed Pydantic v2 Field examples parameter
- Fixed function parameter type hints

**Core Tools (~90 errors fixed):**
- creatives.py: 203 → 115 errors (43% reduction)
- media_buy_update.py: 118 → 107 errors (9% reduction)
- Fixed missing optional fields in constructors
- Fixed Literal type annotations

**Adapters (100% clean on mock_ad_server):**
- mock_ad_server.py: 26 → 0 errors (100% fixed!)
- kevel.py: 47 → 23 errors (51% reduction)
- triton_digital.py: 52 → 31 errors (40% reduction)

**Core Infrastructure:**
- main.py: 64 → 16 errors (75% reduction)

## Test Results

- Unit tests: 906 passed ✅
- Integration tests: 96 passed ✅
- Integration V2 tests: 120 passed ✅
- E2E tests: 28 passed (3 failed due to port conflicts only)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 37cc165 into main Oct 26, 2025
9 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…extprotocol#627)

This is incremental progress on fixing skipped tests and cleaning up type errors.

## Integration Tests Fixed (3 tests)

✅ **test_self_service_signup.py** (13 tests passing)
- Fixed OAuth mocking with proper Flask app context
- Uses `patch.object(app, "oauth")` instead of complex mocking
- Verifies complete signup flow with session management

✅ **test_workflow_lifecycle.py** (7 tests passing)
- Added missing `integration_db` fixture dependency
- Changed `@pytest.mark.skip_ci` to `@pytest.mark.requires_db`

✅ **test_mcp_tool_roundtrip_minimal.py** (9/13 tests passing)
- Fixed to use `mcp_server` fixture instead of manual server
- Updated `mcp_server` fixture to use PostgreSQL (fixes architecture violation)
- Fixed test fixtures with correct Product schema
- Fixed response parsing to use FastMCP's `structured_content`

## mypy Type Errors Fixed (~330 errors, 22% reduction)

**Core Schemas (100% clean):**
- schemas.py: 43 → 0 errors
- Fixed Field() validation constraints (ge/le instead of minimum/maximum)
- Fixed Pydantic v2 Field examples parameter
- Fixed function parameter type hints

**Core Tools (~90 errors fixed):**
- creatives.py: 203 → 115 errors (43% reduction)
- media_buy_update.py: 118 → 107 errors (9% reduction)
- Fixed missing optional fields in constructors
- Fixed Literal type annotations

**Adapters (100% clean on mock_ad_server):**
- mock_ad_server.py: 26 → 0 errors (100% fixed!)
- kevel.py: 47 → 23 errors (51% reduction)
- triton_digital.py: 52 → 31 errors (40% reduction)

**Core Infrastructure:**
- main.py: 64 → 16 errors (75% reduction)

## Test Results

- Unit tests: 906 passed ✅
- Integration tests: 96 passed ✅
- Integration V2 tests: 120 passed ✅
- E2E tests: 28 passed (3 failed due to port conflicts only)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants