Skip to content

Conversation

@jomardyan
Copy link
Owner

Summary

  • replace the root-level test_script.py with a bundled examples/sample_script.py to avoid pytest collection while still providing a quick demo script
  • update setup/release scripts, documentation, and fixtures to reference the new sample script path for clearer guidance
  • keep dashboard test data aligned with the renamed sample script

Testing

  • pytest -q (fails: missing optional dependency httpx for dashboard tests and pre-existing syntax error in tests/test_alerts_monitoring.py)

Codex Task

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the project structure by moving the root-level test_script.py to examples/sample_script.py, preventing pytest from attempting to collect it as a test file while maintaining a quick demonstration script. Additionally, the v7 enhancement wrapper module has been removed in favor of exposing v7 features directly on the ScriptRunner class, and a new --dry-run CLI flag has been added to validate scripts and show execution plans without running them.

Key Changes:

  • Relocated sample script from root to examples directory to avoid pytest collection conflicts
  • Integrated v7 enhancement methods directly into ScriptRunner, removing the separate wrapper module
  • Added get_execution_plan() method and --dry-run CLI flag for execution plan validation

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
examples/sample_script.py New sample script location with updated docstring
test_script.py Removed from root directory
runners/v7_enhancement.py Removed separate v7 enhancement module (291 lines)
runner.py Added get_execution_plan(), --dry-run flag, v7 helper methods (pre_execution_security_scan, scan_dependencies, scan_secrets, start_tracing_span, start_cost_tracking, stop_cost_tracking), and stored config_file and history_db_path
tests/unit/test_runner.py Updated tests to verify v7 features are exposed directly on runner instead of through enhancer
tests/test_runner_core.py Added test for get_execution_plan() method
tests/test_integration.py Added CLI dry-run integration test, added subprocess import
tests/test_dashboard.py Updated test fixture data to reference sample_script.py
tests/conftest.py Updated fixture filename to sample_script.py
dashboard/backend/test_app.py Updated test fixture data to reference sample_script.py
setup.sh Updated all example commands to use examples/sample_script.py
setup.ps1 Updated all example commands to use examples/sample_script.py
release.sh Updated compilation check to use examples/sample_script.py
docs/installation.md Updated example command to use examples/sample_script.py
README.md Added quick start tip mentioning bundled sample script

Comment on lines +2 to +5
"""Simple sample script for Python Script Runner demonstration."""

print("Python Script Runner - Sample Script")
print("✅ Sample completed successfully")
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The sample script should include an explicit exit(0) call for consistency with the original test_script.py and with the pattern used throughout the test suite. While Python scripts implicitly exit with code 0 when they complete successfully, having an explicit exit call makes the intent clear and matches the established pattern in this codebase.

Suggested change
"""Simple sample script for Python Script Runner demonstration."""
print("Python Script Runner - Sample Script")
print("✅ Sample completed successfully")
"""Simple sample script for Python Script Runner demonstration."""
import sys
print("Python Script Runner - Sample Script")
print("✅ Sample completed successfully")
sys.exit(0)

Copilot uses AI. Check for mistakes.
@jomardyan jomardyan merged commit 57fd4b6 into main Nov 20, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants