Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Parallel fixes across test infrastructure and type safety without touching GAM or integration_v2 files.

Changes

✅ Integration Test Fixes

  • Fixed missing imports in test_a2a_response_message_fields.py:
    • AdCPRequestHandler from src.a2a_server.adcp_a2a_server
    • MagicMock/patch from unittest.mock
    • datetime utilities
  • All A2A message field tests now pass

✅ Type Safety (mypy)

  • Fixed duplicate section in mypy.ini (line 89)
  • Reduced errors from 941 to 781 (17% reduction, 160 errors fixed)
  • Files improved:
    • context_manager.py: Fix return types, variable shadowing (6 fixes)
    • oauth_retry.py: Add exception type hints (1 fix)
    • schema_helpers.py: Remove invalid status parameter (1 fix)
    • config_loader.py: Fix get_secret() return type (1 fix)
    • webhook_delivery.py: SQLAlchemy datetime assignments (2 fixes)
    • strategy.py: Add runtime type checks (1 fix)
    • main.py: Fix variable shadowing, None comparisons (3 fixes)

✅ Deprecation Fixes

  • Migrated schema_validation.py from class Config to ConfigDict
  • Eliminates all PydanticDeprecatedSince20 warnings

✅ Runtime Fixes

  • Fixed logging errors during interpreter shutdown:
    • webhook_delivery_service.py _shutdown method
    • delivery_simulator.py _shutdown method
  • Prevents ValueError: I/O operation on closed file

✅ Schema Updates

  • Update generated schema metadata (source_etag, last_modified)
  • Update compliance report from recent schema validation

Testing Strategy

Used 5 parallel debugger agents to:

  1. Fix A2A test import errors
  2. Fix mypy configuration
  3. Fix logging shutdown errors
  4. Verify admin UI tests (they were fine, just needed PostgreSQL)
  5. Reduce mypy errors in core files
  6. Fix Pydantic deprecation warnings

Notes

  • Admin UI tests: Previously showing ERROR status were actually fine, they just need PostgreSQL running (via ./run_all_tests.sh ci)
  • Pre-existing test issue: test_product_deletion.py::test_database_fallback_super_admin_check is missing @pytest.mark.requires_db marker - not introduced by this PR
  • No GAM files touched: Per requirements, no GAM adapter or integration_v2 files modified
  • All fixes verified with test suite

Test Results

  • Unit tests: ✅ Pass
  • Integration tests: ✅ Pass (with PostgreSQL)
  • Mypy errors: ✅ Reduced 17%
  • Deprecation warnings: ✅ Eliminated
  • Logging errors: ✅ Fixed

🤖 Generated with Claude Code

Parallel fixes across test infrastructure and type safety:

**Integration Test Fixes:**
- Add missing imports in test_a2a_response_message_fields.py
  - AdCPRequestHandler from src.a2a_server.adcp_a2a_server
  - MagicMock/patch from unittest.mock
  - datetime utilities
- All A2A message field tests now pass

**Type Safety (mypy):**
- Fix duplicate section in mypy.ini (line 89)
- Reduce errors from 941 to 781 (17% reduction, 160 errors fixed)
- Files improved:
  - context_manager.py: Fix return types, variable shadowing
  - oauth_retry.py: Add exception type hints
  - schema_helpers.py: Remove invalid status parameter
  - config_loader.py: Fix get_secret() return type
  - webhook_delivery.py: SQLAlchemy datetime assignments
  - strategy.py: Add runtime type checks
  - main.py: Fix variable shadowing, None comparisons

**Deprecation Fixes:**
- Migrate schema_validation.py from class Config to ConfigDict
- Eliminates all PydanticDeprecatedSince20 warnings

**Runtime Fixes:**
- Fix logging errors during interpreter shutdown
- Add try-except in webhook_delivery_service.py _shutdown
- Add try-except in delivery_simulator.py _shutdown
- Prevents "ValueError: I/O operation on closed file"

**Schema Updates:**
- Update generated schema metadata (source_etag, last_modified)
- Update compliance report from recent schema validation

All fixes verified with test suite. No GAM or integration_v2 files touched.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit be52151 into main Oct 26, 2025
9 checks passed
bokelley added a commit that referenced this pull request Oct 26, 2025
Merged PRs #628 and #629 from main:
- fix: Integration tests, mypy errors, and deprecation warnings (#628)
- fix: Clean up smoke tests and resolve warnings (#629)

Conflict resolution:
- webhook_delivery_service.py: Accepted main's cleaner error handling
  (single try-except catching ValueError and OSError)

Changes from main:
- Schema regeneration (extra='forbid' → extra='ignore')
- Mypy configuration updates (1081 errors, down from 1586)
- Smoke test cleanup (removed test_smoke_critical_paths.py)
- Deprecation warning fixes
- Integration test improvements
bokelley added a commit that referenced this pull request Oct 26, 2025
Resolved conflicts in test_signals_agent_workflow.py:
- Updated to use origin/main's improved mocking patterns with ExitStack
- Removed signals_agent_config from tenant_dict (we removed that field)
- Used complete SignalDeployment fields (account, estimated_activation_duration_minutes)
- Renamed _add_test_products_v2 to _add_test_products
- Added add_required_setup_data call for proper test setup

Brings in:
- Integration test improvements (#631, #626, #629, #628)
- Mypy error reductions
- Test infrastructure improvements
- 100% integration_v2 test coverage
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…extprotocol#628)

Parallel fixes across test infrastructure and type safety:

**Integration Test Fixes:**
- Add missing imports in test_a2a_response_message_fields.py
  - AdCPRequestHandler from src.a2a_server.adcp_a2a_server
  - MagicMock/patch from unittest.mock
  - datetime utilities
- All A2A message field tests now pass

**Type Safety (mypy):**
- Fix duplicate section in mypy.ini (line 89)
- Reduce errors from 941 to 781 (17% reduction, 160 errors fixed)
- Files improved:
  - context_manager.py: Fix return types, variable shadowing
  - oauth_retry.py: Add exception type hints
  - schema_helpers.py: Remove invalid status parameter
  - config_loader.py: Fix get_secret() return type
  - webhook_delivery.py: SQLAlchemy datetime assignments
  - strategy.py: Add runtime type checks
  - main.py: Fix variable shadowing, None comparisons

**Deprecation Fixes:**
- Migrate schema_validation.py from class Config to ConfigDict
- Eliminates all PydanticDeprecatedSince20 warnings

**Runtime Fixes:**
- Fix logging errors during interpreter shutdown
- Add try-except in webhook_delivery_service.py _shutdown
- Add try-except in delivery_simulator.py _shutdown
- Prevents "ValueError: I/O operation on closed file"

**Schema Updates:**
- Update generated schema metadata (source_etag, last_modified)
- Update compliance report from recent schema validation

All fixes verified with test suite. No GAM or integration_v2 files touched.

🤖 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