Complete P1-004: Testing Manual Packages and reorganize test files

- 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>
This commit is contained in:
2025-09-10 01:25:27 +03:00
parent 1dc5da4ed2
commit 52454a5925
13 changed files with 1722 additions and 25 deletions

58
api/tests/apply_fix.py Normal file
View File

@@ -0,0 +1,58 @@
#!/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()