fix: resolve YAML indentation issues in Python debugging script
Some checks failed
audit / audit (push) Has been skipped
ci-cd / build (push) Has been skipped
ci / build (push) Has been skipped
autofix / fix (push) Has been skipped
python-tests / test (push) Failing after 18s
python-tests / test-specific (push) Has been skipped
security-scanning / audit (push) Has been skipped
test / test (push) Has been skipped
ci-cd / deploy (push) Has been skipped
ci / deploy (push) Has been skipped

YAML INDENTATION FIX: Use single-line Python commands to avoid indentation

Issue:
- IndentationError persists due to YAML multi-line string handling
- Multi-line Python strings in YAML cause indentation conflicts
- Workflow still failing with syntax errors

Solution:
- Use single-line Python commands with exec()
- Escape newlines with \n in exec() strings
- Separate commands for each import test
- Avoid YAML multi-line string indentation issues

Changes:
- Single-line venv/bin/python -c commands
- exec() with escaped newlines for try/except blocks
- Separate commands for src and aitbc imports
- Maintains debugging functionality without YAML conflicts

Expected results:
- No more IndentationError
- Import debugging should work
- Workflow should continue to pytest execution
- Clear feedback on import success/failure

This should finally resolve the YAML/Python indentation conflict
and allow the workflow to proceed to actual test execution.
This commit is contained in:
2026-03-27 20:48:18 +01:00
parent 536f7afbcc
commit 8d6a05f09c

View File

@@ -128,24 +128,8 @@ jobs:
# Test specific imports that are failing
echo "Testing problematic imports..."
venv/bin/python -c "
import sys
print('Testing src import...')
sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/agent-protocols/src')
try:
import message_protocol
print('✅ src.message_protocol import successful')
except Exception as e:
print(f'❌ src import failed: {e}')
print('Testing aitbc import...')
sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/blockchain-node/src')
try:
import aitbc_chain
print('✅ aitbc_chain import successful')
except Exception as e:
print(f'❌ aitbc import failed: {e}')
"
venv/bin/python -c "import sys; print('Testing src import...'); sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/agent-protocols/src'); exec('try:\n import message_protocol\n print(\"✅ src.message_protocol import successful\")\nexcept Exception as e:\n print(f\"❌ src import failed: {e}\n')"
venv/bin/python -c "import sys; print('Testing aitbc import...'); sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/blockchain-node/src'); exec('try:\n import aitbc_chain\n print(\"✅ aitbc_chain import successful\")\nexcept Exception as e:\n print(f\"❌ aitbc import failed: {e}\n')"
echo "=== RUNNING PYTHON TESTS ==="
echo "Attempting to run tests with comprehensive error handling..."