Skip to content

fix tests#23

Merged
isaacbmiller merged 1 commit into
mainfrom
isaac/fix-interactive-tests
Nov 14, 2025
Merged

fix tests#23
isaacbmiller merged 1 commit into
mainfrom
isaac/fix-interactive-tests

Conversation

@isaacbmiller
Copy link
Copy Markdown
Contributor

No description provided.

@isaacbmiller isaacbmiller merged commit fabb198 into main Nov 14, 2025
1 check passed
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Nov 14, 2025

Greptile Overview

Greptile Summary

Fixed test failures caused by the interactive mode changes in PR #21 by making tests non-interactive and updating expected file paths.

Changes made:

  • Added --api-key option to new command for non-interactive testing
  • Created with_new_defaults() helper to inject all required parameters (--program-name, --module-type, --signature, --model, --api-key)
  • Updated test assertions to expect main_predict.py and main.py instead of project-name-based files
  • Fixed test fixture in integration tests to pass non-interactive parameters

Confidence Score: 5/5

  • This PR is safe to merge - it only fixes test infrastructure without changing production code behavior
  • All changes are test-only fixes that adapt to the interactive mode introduced in PR Interactive #21. The production code change adds a single optional CLI parameter that integrates cleanly with existing logic. No logical errors, security issues, or breaking changes.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/dspy_cli/commands/new.py 5/5 Added --api-key CLI option to bypass interactive prompt, allowing non-interactive test execution
tests/test_commands_smoke.py 5/5 Added with_new_defaults() helper to inject required parameters and updated tests to use correct file paths with "main" program name
tests/test_serve_integration.py 5/5 Updated test fixture to provide non-interactive defaults and fixed expected module path from testpkg_predict.py to main_predict.py

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant CLI as CLI (new command)
    participant Interactive as Interactive Prompts
    participant Files as File System
    
    Note over Test,Files: Before PR #23 (broken)
    Test->>CLI: invoke new without params
    CLI->>Interactive: prompt for missing values
    Interactive-->>CLI: (blocks in test)
    Note over Test: ❌ Tests hang/fail
    
    Note over Test,Files: After PR #23 (fixed)
    Test->>Test: with_new_defaults(args)
    Note over Test: adds --program-name, --module-type,<br/>--signature, --model, --api-key
    Test->>CLI: invoke new with all params
    CLI->>CLI: use provided api_key value
    Note over CLI: skip interactive prompt
    CLI->>Files: create project with "main" program
    Files-->>CLI: success
    CLI-->>Test: exit_code=0
    Test->>Test: assert main_predict.py exists
    Note over Test: ✅ Tests pass
Loading

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

1 participant