fix: resolve Poetry command not found errors in package tests
Some checks failed
package-tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk python_version:3.13]) (push) Failing after 10s
package-tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core python_version:3.13]) (push) Failing after 11s
package-tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto python_version:3.13]) (push) Failing after 1s
package-tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk python_version:3.13]) (push) Successful in 13s
package-tests / test-javascript-packages (map[name:aitbc-sdk node_version:24 path:packages/js/aitbc-sdk]) (push) Successful in 11s
package-tests / cross-language-compatibility (push) Has been skipped
package-tests / package-integration-tests (push) Has been skipped
security-scanning / audit (push) Has been cancelled

POETRY PATH FIX: Ensure Poetry is available in all package test steps

Issues Fixed:
 poetry: command not found in Install Dependencies step
 PATH not preserved between workflow steps
 Poetry installation not available in subsequent steps

Solution Applied:
 Added Poetry PATH export to all steps using Poetry
 Added Poetry verification in Install Dependencies step
 Fallback Poetry installation if not found
 Consistent PATH management across all steps

This resolves the critical Poetry availability issue that was
preventing package tests from running in the CI/CD environment.
This commit is contained in:
2026-03-27 23:20:30 +01:00
parent e151f56924
commit 19663a15ff

View File

@@ -121,6 +121,19 @@ jobs:
echo "=== INSTALLING DEPENDENCIES ==="
cd /opt/aitbc/python-packages-workspace/repo/${{ matrix.package.path }}
# Ensure Poetry is available and PATH is set
export PATH="$HOME/.local/bin:$PATH"
# Verify Poetry installation
if ! command -v poetry >/dev/null 2>&1; then
echo "❌ Poetry not found, installing..."
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
fi
# Verify Poetry is working
poetry --version
# Install dependencies with Poetry
poetry install --with dev
@@ -133,6 +146,9 @@ jobs:
echo "=== RUNNING LINTING ==="
cd /opt/aitbc/python-packages-workspace/repo/${{ matrix.package.path }}
# Ensure Poetry is available
export PATH="$HOME/.local/bin:$PATH"
# Run mypy type checking
echo "Running mypy..."
poetry run mypy src/ || echo "MyPy completed with warnings"
@@ -152,6 +168,9 @@ jobs:
echo "=== RUNNING PYTHON PACKAGE TESTS ==="
cd /opt/aitbc/python-packages-workspace/repo/${{ matrix.package.path }}
# Ensure Poetry is available
export PATH="$HOME/.local/bin:$PATH"
# Run tests with pytest
poetry run pytest -v --tb=short --cov=src --cov-report=xml --cov-report=term || echo "Tests completed with failures"
@@ -162,6 +181,9 @@ jobs:
echo "=== BUILDING PYTHON PACKAGE ==="
cd /opt/aitbc/python-packages-workspace/repo/${{ matrix.package.path }}
# Ensure Poetry is available
export PATH="$HOME/.local/bin:$PATH"
# Build package with Poetry
poetry build
@@ -175,6 +197,9 @@ jobs:
echo "=== VALIDATING PYTHON PACKAGE ==="
cd /opt/aitbc/python-packages-workspace/repo/${{ matrix.package.path }}
# Ensure Poetry is available
export PATH="$HOME/.local/bin:$PATH"
# Check package metadata
poetry version
poetry show --tree