-
Notifications
You must be signed in to change notification settings - Fork 1
Add python case for test validator tests #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 extends the test validator to support Python tests by adding Python test creation capabilities, directory setup, and feature file tagging alongside the existing Rust, JDBC, and ODBC test support.
Key changes:
- Added Python test creation helper method and directory structure setup
- Updated feature tags to include
@python_e2emarkers - Incremented test validation count from 3 to 4 languages
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # And I should have access to the system | ||
| result = conn.cursor().execute(f"SELECT * FROM temporary_resource") | ||
| assert len(result) is not None, "Should have system access" |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using is not None with len() is incorrect. The len() function returns an integer (0 or more), not None. This assertion will always pass because any integer (including 0) is not None. Consider using len(result) > 0 or assert result to check if the result is non-empty.
| assert len(result) is not None, "Should have system access" | |
| assert len(result) > 0, "Should have system access" |
| finally: | ||
| try: | ||
| cursor.execute(f"DROP TABLE IF EXISTS temporary_resource") |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable cursor is referenced but not defined in the finally block. It should be conn.cursor() or cursor should be defined earlier in the test (e.g., cursor = conn.cursor() after line 1114). This will cause a NameError at runtime.
|
|
||
| fn create_complete_python_login_test() -> &'static str { | ||
| r#" | ||
| def test_successful_login_with_valid_credentials(self, connect): |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function signature includes self parameter, suggesting this is a class method. However, looking at existing Python e2e tests in the repository (e.g., test_put_get_basic_operations.py), standalone test functions are typically used without the self parameter. For class-based tests (like in test_pat.py), the test should be part of a proper test class. Consider either:
- Removing
selfif this is meant to be a standalone function test - Wrapping this in a proper test class if it needs to be a method
| def test_successful_login_with_valid_credentials(self, connect): | |
| def test_successful_login_with_valid_credentials(connect): |
| def test_successful_login_with_valid_credentials(self, connect): | ||
| # Given I have valid credentials | ||
| credentials = setup_valid_credentials() | ||
| table_name = "test_login_table" |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable table_name is defined but never used in the test. Consider removing it or using it in the test logic.
| table_name = "test_login_table" |
d6a9e55 to
03e4368
Compare
Add python to test validator tests