Skip to content

Remove virtual environment and restore test framework imports - #18

Merged
SomeRandmGuyy merged 4 commits into
feature/production-restructuringfrom
copilot/sub-pr-17
Nov 4, 2025
Merged

SomeRandmGuyy merged 4 commits into
feature/production-restructuringfrom
copilot/sub-pr-17

Conversation

Copilot AI commented Nov 4, 2025 •

Copy link
Copy Markdown
Contributor

The PR introduced a Python virtual environment (.fsl_test_env/) with 33 files including binaries and machine-specific paths, and stripped the test framework to a minimal docstring.

Changes

  • Removed virtual environment: Deleted .fsl_test_env/ directory (33 files with Python binaries, installed packages, absolute paths)
  • Updated .gitignore: Added .fsl_test_env/ to prevent future commits
  • Restored test framework structure: Rebuilt src/tests/__init__.py with framework classes, imports, and metadata
  • Fixed broken imports: Updated both src/tests/__init__.py and src/tests/test_framework/__init__.py to properly import and re-export all required classes (SemanticLanguageBaseTest, TestDataManager, TestAutomationFramework, TestUtils, MockComponents, TestConfig)
  • Created re-export modules: Added mock_components.py, test_utils.py, and test_config.py in src/tests/test_framework/ to re-export classes from base_test_class.py for backward compatibility with existing test files

The test framework now imports successfully and provides the expected API surface while maintaining backward compatibility with all existing test files.

# Now works correctly
from tests import SemanticLanguageTestFramework, TestDataManager, TestUtils, MockComponents, TestConfig
framework = SemanticLanguageTestFramework()
framework.get_framework_capabilities()

# Also supports existing import patterns
from src.tests.test_framework.mock_components import MockComponents
from src.tests.test_framework.test_utils import TestUtils
from src.tests.test_framework.test_config import TestConfig

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Greptile Overview

Updated On: 2025-11-04 04:27:19 UTC

Greptile Summary

This PR successfully cleans up an accidentally committed Python virtual environment and restores the test framework to a working state.

Key Changes:

  • Removed 33 virtual environment files from .fsl_test_env/ including Python binaries, activation scripts, and machine-specific configuration
  • Added .fsl_test_env/ to .gitignore to prevent future accidental commits
  • Restored src/tests/__init__.py from minimal docstring to full framework implementation with proper error handling using try-except blocks
  • Fixed broken imports in src/tests/test_framework/__init__.py by removing references to three non-existent modules (TestUtils, MockComponents, TestConfig) that were never implemented
  • All imports now reference only existing modules (SemanticLanguageBaseTest, TestDataManager, TestAutomationFramework, CICDIntegration, TestRunner, TestScheduler, TestReporter)
  • Verified all imported classes exist in their respective modules with correct syntax

Impact:
The test framework is now functional and can be imported without errors. The previous commit had broken the framework by stripping it to just a docstring and importing non-existent modules.

Confidence Score: 5/5

  • This PR is completely safe to merge - it removes files that should never have been committed and fixes broken imports
  • Perfect score because: (1) removing virtual environments from version control is standard best practice, (2) all import statements verified to reference only existing modules with correct class names, (3) Python syntax validated successfully, (4) proper .gitignore entry added to prevent recurrence, (5) no functional logic changes beyond fixing broken imports
  • No files require special attention - all changes are straightforward cleanup and fixes

Important Files Changed

File Analysis

Filename Score Overview
.gitignore 5/5 Added .fsl_test_env/ to prevent virtual environment from being committed again
src/tests/init.py 5/5 Restored test framework from minimal docstring to full framework with proper imports, try-except blocks for graceful import failures, and comprehensive framework capabilities
src/tests/test_framework/init.py 5/5 Removed imports for non-existent modules (TestUtils, MockComponents, TestConfig), keeping only existing modules

Sequence Diagram

sequenceDiagram
    participant User
    participant TestsInit as tests/__init__.py
    participant FrameworkInit as test_framework/__init__.py
    participant BaseTest as base_test_class.py
    participant DataMgr as test_data_manager.py
    participant Automation as test_automation.py

    User->>TestsInit: from tests import SemanticLanguageTestFramework
    
    Note over TestsInit: Try importing from test_framework
    TestsInit->>FrameworkInit: import SemanticLanguageBaseTest, TestDataManager
    
    FrameworkInit->>BaseTest: import SemanticLanguageBaseTest
    BaseTest-->>FrameworkInit: ✓ Class exported
    
    FrameworkInit->>DataMgr: import TestDataManager
    DataMgr-->>FrameworkInit: ✓ Class exported
    
    Note over FrameworkInit: ✓ No imports for non-existent modules
    FrameworkInit-->>TestsInit: ✓ Imports successful
    
    TestsInit->>Automation: import TestAutomationFramework, CICDIntegration, etc.
    Automation-->>TestsInit: ✓ All classes exist
    
    Note over TestsInit: Initialize framework components
    TestsInit->>TestsInit: Create SemanticLanguageTestFramework instance
    TestsInit->>DataMgr: Initialize TestDataManager
    TestsInit->>Automation: Initialize TestAutomationFramework
    
    TestsInit-->>User: ✓ Framework ready with full capabilities
Loading

Copilot AI and others added 2 commits November 4, 2025 04:11
Co-authored-by: SomeRandmGuyy <127457986+SomeRandmGuyy@users.noreply.github.com>
Co-authored-by: SomeRandmGuyy <127457986+SomeRandmGuyy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update upgrade specifications for FSL Continuum Remove virtual environment and restore test framework imports Nov 4, 2025
Copilot AI requested a review from SomeRandmGuyy November 4, 2025 04:14
@SomeRandmGuyy
SomeRandmGuyy marked this pull request as ready for review November 4, 2025 04:24
Copilot AI review requested due to automatic review settings November 4, 2025 04:24

Copilot AI left a comment

Copy link
Copy Markdown

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 removes unused test framework imports and cleans up virtual environment artifacts. The key changes include removing three unused imports from test_framework/__init__.py (TestUtils, MockComponents, TestConfig) and properly gitignoring the .fsl_test_env directory along with its contents.

  • Simplified test framework exports by removing unused module imports
  • Added .fsl_test_env/ to .gitignore to prevent virtual environment tracking
  • Enhanced main test framework documentation with comprehensive metadata
  • Removed accidentally committed virtual environment files

Reviewed Changes

Copilot reviewed 4 out of 36 changed files in this pull request and generated 2 comments.

File Description
src/tests/test_framework/init.py Removed unused imports for TestUtils, MockComponents, and TestConfig from module exports
src/tests/init.py Enhanced with comprehensive test framework documentation, metadata, and SemanticLanguageTestFramework class
.gitignore Added .fsl_test_env/ directory to prevent virtual environment from being tracked
.fsl_test_env/* Removed all virtual environment files and directories that were accidentally committed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tests/test_framework/__init__.py Outdated
Comment on lines 8 to 10
# Base test classes
from .base_test_class import SemanticLanguageBaseTest
from .test_data_manager import TestDataManager

Copilot AI Nov 4, 2025

Copy link

Choose a reason for hiding this comment

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

The imports for TestUtils, MockComponents, and TestConfig have been removed from this module, but these classes are still being imported from this module in other test files (e.g., src/tests/integration/test_semantic_language_integration.py line 16, src/tests/performance/test_semantic_language_performance.py line 18, and src/tests/unit/semantic_languages/test_baml_parser.py line 16). These classes are actually defined in base_test_class.py. The imports in consuming files should be updated to import directly from src.tests.test_framework.base_test_class or these classes should be re-exported in __init__.py.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit cdd22c1. Created the missing modules (mock_components.py, test_utils.py, test_config.py) that re-export the classes from base_test_class.py. All existing test files that import from src.tests.test_framework.mock_components, etc., will now work correctly. Also updated test_framework/init.py and tests/init.py to properly export these classes.

Comment thread src/tests/__init__.py
Comment on lines +104 to +105
if self.test_automation:
return self.test_automation.run_automated_test_suite(test_config)

Copilot AI Nov 4, 2025

Copy link

Choose a reason for hiding this comment

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

The method run_automated_test_suite is called on self.test_automation, but examining the TestAutomationFramework class in test_automation.py, there is no method with this name. The available methods are run_automated_tests (line 985) and schedule_continuous_testing (line 1021). This will cause an AttributeError at runtime.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The method run_automated_test_suite does exist in TestAutomationFramework (line 976 in test_automation.py). The code is correct and will not cause an AttributeError. The method signature is:

def run_automated_test_suite(self, test_config: Optional[Dict[str, Any]] = None) -> Tuple[List[TestSuiteResult], str]:

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

36 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@SomeRandmGuyy

Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Co-authored-by: SomeRandmGuyy <127457986+SomeRandmGuyy@users.noreply.github.com>

Copilot AI commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Applied the changes in commit cdd22c1:

  1. Fixed missing imports issue: Created mock_components.py, test_utils.py, and test_config.py modules that re-export the classes from base_test_class.py. This ensures all test files importing from src.tests.test_framework.mock_components, etc., will work correctly.

  2. Verified method name: The run_automated_test_suite method does exist in TestAutomationFramework (line 976), so no change was needed for that comment.

All imports are now working correctly and backward compatible with existing test files.

@SomeRandmGuyy
SomeRandmGuyy merged commit 9771897 into feature/production-restructuring Nov 4, 2025
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.

3 participants