- Complete manual testing of all Oracle PL/SQL packages - Document 75% success rate (3/4 components passing) - Move all test scripts from api/ to api/tests/ subdirectory - Update P1-004 story with comprehensive test results - Identify external dependency blocking full order import - Mark Phase 1 as 95% complete, ready for Phase 2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Apply the no-logging fix to gaseste_articol_roa
|
|
"""
|
|
|
|
import oracledb
|
|
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv('.env')
|
|
|
|
user = os.environ['ORACLE_USER']
|
|
password = os.environ['ORACLE_PASSWORD']
|
|
dsn = os.environ['ORACLE_DSN']
|
|
|
|
try:
|
|
instantclient_path = os.environ.get('INSTANTCLIENTPATH', '/opt/oracle/instantclient_23_9')
|
|
oracledb.init_oracle_client(lib_dir=instantclient_path)
|
|
except Exception as e:
|
|
pass
|
|
|
|
def apply_fix():
|
|
"""Apply the no-logging fix"""
|
|
print("🔧 Applying no-logging fix to gaseste_articol_roa...")
|
|
|
|
# Read the fix SQL
|
|
with open('/app/fix_gaseste_articol.sql', 'r') as f:
|
|
fix_sql = f.read()
|
|
|
|
try:
|
|
with oracledb.connect(user=user, password=password, dsn=dsn) as conn:
|
|
with conn.cursor() as cur:
|
|
|
|
# Execute the fix
|
|
cur.execute(fix_sql)
|
|
print("✅ No-logging package applied successfully")
|
|
|
|
# Test the fixed function
|
|
cur.execute("""
|
|
SELECT * FROM TABLE(PACK_IMPORT_COMENZI.gaseste_articol_roa('CAF01', 25.0, 1))
|
|
""")
|
|
|
|
results = cur.fetchall()
|
|
print(f"✅ Fixed function test: {len(results)} results")
|
|
for result in results:
|
|
print(f" Success: {result[4]}, CODMAT: {result[1]}")
|
|
|
|
return True
|
|
|
|
except Exception as e:
|
|
print(f"❌ Apply fix failed: {e}")
|
|
return False
|
|
|
|
def main():
|
|
apply_fix()
|
|
|
|
if __name__ == "__main__":
|
|
main() |