Files
aitbc/.gitea/workflows/production-tests.yml
aitbc e4f1a96172
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 8s
CLI Tests / test-cli (push) Successful in 10s
Contract Performance Benchmarks / benchmark-gas-usage (push) Successful in 1m22s
Contract Performance Benchmarks / benchmark-execution-time (push) Successful in 1m11s
Contract Performance Benchmarks / benchmark-throughput (push) Successful in 1m13s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Failing after 5s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 5s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Failing after 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Cross-Node Transaction Testing / transaction-test (push) Successful in 5s
Deploy to Testnet / deploy-testnet (push) Successful in 1m14s
Contract Performance Benchmarks / compare-benchmarks (push) Has been cancelled
Documentation Validation / validate-docs (push) Failing after 10s
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Smart Contract Tests / test-solidity (map[name:aitbc-contracts path:contracts]) (push) Has been cancelled
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Has been cancelled
Smart Contract Tests / test-foundry (push) Has been cancelled
Smart Contract Tests / lint-solidity (push) Has been cancelled
Smart Contract Tests / deploy-contracts (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 3s
Integration Tests / test-service-integration (push) Failing after 45s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Failing after 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 5s
P2P Network Verification / p2p-verification (push) Successful in 3s
Production Tests / Production Integration Tests (push) Failing after 7s
Python Tests / test-python (push) Failing after 46s
Staking Tests / test-staking-service (push) Failing after 2s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
Systemd Sync / sync-systemd (push) Successful in 21s
API Endpoint Tests / test-api-endpoints (push) Failing after 12m19s
ci: standardize pytest invocation and add security scanning
- Changed pytest calls to use `venv/bin/python -m pytest` with explicit config
- Added `--rootdir "$PWD"` and `--import-mode=importlib` for consistent imports
- Fixed PYTHONPATH to use absolute paths with $PWD prefix
- Added smart contract security scanning for Solidity files
- Added Circom circuit security checks for ZK proof circuits
- Added ZK proof implementation security validation
- Added contracts/** to security scanning workflow
2026-05-11 13:46:42 +02:00

157 lines
5.3 KiB
YAML

name: Production Tests
on:
push:
branches: [main, develop]
paths:
- 'tests/production/**'
- 'apps/agent-coordinator/**'
- '.gitea/workflows/production-tests.yml'
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: production-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test-production:
name: Production Integration Tests
runs-on: debian
timeout-minutes: 20
steps:
- name: Clone repository
run: |
WORKSPACE="/var/lib/aitbc-workspaces/production-tests"
rm -rf "$WORKSPACE"
mkdir -p "$WORKSPACE"
cd "$WORKSPACE"
git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo
- name: Initialize job logging
run: |
cd /var/lib/aitbc-workspaces/production-tests/repo
bash scripts/ci/setup-job-logging.sh
- name: Setup test environment
run: |
cd /var/lib/aitbc-workspaces/production-tests/repo
# Remove any existing venv to avoid cache corruption issues
rm -rf venv
bash scripts/ci/setup-python-venv.sh \
--repo-dir "$PWD" \
--venv-dir "$PWD/venv" \
--skip-requirements \
--extra-packages "pytest pytest-asyncio pytest-timeout requests httpx pyjwt fastapi uvicorn[standard] redis bcrypt websockets numpy psutil prometheus-client celery aiohttp pydantic pydantic-settings python-dotenv cryptography"
# Ensure standard directories exist
mkdir -p /var/lib/aitbc/data /var/lib/aitbc/keystore /etc/aitbc /var/log/aitbc
- name: Ensure Redis server
run: |
if command -v redis-server >/dev/null 2>&1 && command -v redis-cli >/dev/null 2>&1; then
echo "✅ Redis binaries already available"
exit 0
fi
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y redis-server
- name: Start Redis
run: |
redis-server --daemonize yes --port 6379
sleep 2
redis-cli ping || exit 1
echo "✅ Redis started"
- name: Start agent coordinator
run: |
cd /var/lib/aitbc-workspaces/production-tests/repo
export PYTHONPATH="apps/agent-coordinator/src:$PYTHONPATH"
echo "Ensuring default port 9001 is available..."
pkill -f "uvicorn app.main:app" 2>/dev/null || true
if command -v lsof >/dev/null 2>&1; then
pids=$(lsof -tiTCP:9001 -sTCP:LISTEN || true)
if [ -n "$pids" ]; then
echo "⚠️ Port 9001 already in use by PID(s): $pids; terminating"
kill $pids 2>/dev/null || true
sleep 2
fi
if lsof -tiTCP:9001 -sTCP:LISTEN >/dev/null 2>&1; then
echo "❌ Port 9001 is still in use; aborting startup"
lsof -iTCP:9001 -sTCP:LISTEN || true
exit 1
fi
fi
# Start agent coordinator in background
nohup env PYTHONUNBUFFERED=1 venv/bin/uvicorn app.main:app \
--host 0.0.0.0 \
--port 9001 \
--log-level info \
> /tmp/agent-coordinator.log 2>&1 &
echo $! > /tmp/agent-coordinator.pid
sleep 2
if ! kill -0 "$(cat /tmp/agent-coordinator.pid)" 2>/dev/null; then
echo "❌ Agent coordinator exited during startup"
cat /tmp/agent-coordinator.log
exit 1
fi
echo "✅ Agent coordinator started (PID: $(cat /tmp/agent-coordinator.pid))"
- name: Wait for agent coordinator ready
run: |
echo "Waiting for agent coordinator on port 9001..."
for i in $(seq 1 30); do
code=$(curl -so /dev/null -w '%{http_code}' "http://localhost:9001/health" 2>/dev/null) || code=0
if [ "$code" -ge 200 ] && [ "$code" -lt 600 ]; then
echo "✅ Agent coordinator ready (HTTP $code)"
exit 0
fi
sleep 2
done
echo "❌ Agent coordinator not ready"
cat /tmp/agent-coordinator.log
exit 1
- name: Run production tests
run: |
cd /var/lib/aitbc-workspaces/production-tests/repo
export PYTHONPATH="apps/agent-coordinator/src:$PYTHONPATH"
# Test both chains
export CHAINS="ait-mainnet,ait-testnet"
venv/bin/python -m pytest -c /dev/null --rootdir "$PWD" --import-mode=importlib tests/production/ \
-v \
--tb=short \
--timeout=30 \
-k "not test_error_handling"
echo "✅ Production tests completed"
- name: Agent coordinator logs
if: always()
run: |
if [ -f /tmp/agent-coordinator.log ]; then
echo "=== Agent Coordinator Logs ==="
cat /tmp/agent-coordinator.log
fi
- name: Cleanup
if: always()
run: |
if [ -f /tmp/agent-coordinator.pid ]; then
kill $(cat /tmp/agent-coordinator.pid) 2>/dev/null || true
rm -f /tmp/agent-coordinator.pid
fi
pkill -f "uvicorn app.main:app" 2>/dev/null || true
redis-cli shutdown 2>/dev/null || true
rm -rf /var/lib/aitbc-workspaces/production-tests