Add failing tests for #25: version command side effects#390
Draft
jiaminc-cmu wants to merge 1 commit intomainfrom
Draft
Add failing tests for #25: version command side effects#390jiaminc-cmu wants to merge 1 commit intomainfrom
jiaminc-cmu wants to merge 1 commit intomainfrom
Conversation
Add tests that verify `pdd --version` and `pdd --help` do not emit INFO logs or warnings from LLM infrastructure initialization. Tests included: - test_version_output_has_no_side_effects: Main test for --version - test_help_output_has_no_side_effects: Same for --help - test_version_output_clean_inside_project_directory: Verify in project dir - test_cli_import_chain_for_version_does_not_trigger_llm_invoke: Import isolation - test_version_command_performance: Performance benchmark These tests currently FAIL, confirming the bug. They will pass once the eager module imports in pdd/cli.py are made lazy. Fixes #25 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds failing E2E tests that detect the bug reported in #25 (Linux diagnostics / version command side effects).
Test File
tests/test_e2e_issue_25_version_side_effects.pyWhat This PR Contains
pdd --versionandpdd --helpshould NOT emit INFO logs or warningsTest Details
test_version_output_has_no_side_effects--versionhas clean outputtest_help_output_has_no_side_effects--helphas clean outputtest_version_output_clean_inside_project_directorytest_cli_import_chain_for_version_does_not_trigger_llm_invokepdd.core.cliis cleantest_version_command_performanceRoot Cause
Eager module-level imports in
pdd/cli.py:17-41trigger a chain that loadspdd/llm_invoke.py, which has extensive module-level initialization code that runs during import. This includes:Import chain:
pdd/cli.py→code_generator_main.py→code_generator.py→llm_invoke.pyRecommended Fix
pdd/cli.pylazy (import inside functions/when needed)llm_invoke.pyusing lazy patternsNext Steps
pdd/cli.py:17-41Fixes #25
Generated by PDD agentic bug workflow