Reorganize testing infrastructure and fix Oracle cursor loop syntax
Major changes: - Fix cursor loop syntax in 04_import_comenzi.sql using BULK COLLECT pattern - Remove obsolete test scripts (apply_fix.py, check_*.py, debug_functions.py, test_*.py) - Add comprehensive README.md files for api/ and api/tests/ directories - Keep only essential testing scripts (final_validation.py, test_syntax.py) - Update PRD.md with latest project status 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
59
api/tests/test_syntax.py
Normal file
59
api/tests/test_syntax.py
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to check package compilation errors
|
||||
"""
|
||||
|
||||
import os
|
||||
import oracledb
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
def check_compilation_errors():
|
||||
"""Check for compilation errors in the package"""
|
||||
|
||||
user = os.environ['ORACLE_USER']
|
||||
password = os.environ['ORACLE_PASSWORD']
|
||||
dsn = os.environ['ORACLE_DSN']
|
||||
|
||||
try:
|
||||
oracledb.init_oracle_client()
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
with oracledb.connect(user=user, password=password, dsn=dsn) as conn:
|
||||
with conn.cursor() as cursor:
|
||||
|
||||
# Check for compilation errors
|
||||
cursor.execute("""
|
||||
SELECT line, position, text, name
|
||||
FROM user_errors
|
||||
WHERE name = 'PACK_IMPORT_COMENZI'
|
||||
ORDER BY sequence
|
||||
""")
|
||||
|
||||
errors = cursor.fetchall()
|
||||
if errors:
|
||||
print("🔴 Compilation Errors:")
|
||||
for err in errors:
|
||||
print(f"Line {err[0]}, Position {err[1]}: {err[2]}")
|
||||
else:
|
||||
print("✅ No compilation errors found")
|
||||
|
||||
# Check package status
|
||||
cursor.execute("""
|
||||
SELECT object_name, status, object_type
|
||||
FROM user_objects
|
||||
WHERE object_name = 'PACK_IMPORT_COMENZI'
|
||||
""")
|
||||
|
||||
status = cursor.fetchall()
|
||||
for obj in status:
|
||||
print(f"📦 {obj[2]}: {obj[0]} - Status: {obj[1]}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_compilation_errors()
|
||||
Reference in New Issue
Block a user