Skip to content

05. OpenClaw2OpenViking Memory Tests #521

05. OpenClaw2OpenViking Memory Tests

05. OpenClaw2OpenViking Memory Tests #521

Workflow file for this run

name: 05. OpenClaw2OpenViking Memory Tests
on:
release:
types: [prereleased]
schedule:
- cron: '0 2,10 * * *'
workflow_dispatch:
inputs:
skip_tests:
description: 'Skip tests (for emergency releases)'
required: false
type: boolean
default: false
release_tag:
description: 'Release tag to associate with this test run'
required: false
type: string
permissions:
contents: read
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
p0-tests:
name: P0 Memory Tests
runs-on: [self-hosted, linux, x64]
timeout-minutes: 100
if: >-
inputs.skip_tests != true &&
(github.event_name == 'workflow_dispatch' ||
(github.repository == 'volcengine/OpenViking' &&
(github.event_name != 'release' || startsWith(github.event.release.tag_name, 'v'))))
steps:
- name: Clean up previous artifacts
run: |
echo "🧹 Cleaning up previous artifacts..."
# Clean up old test reports
echo " - Removing old test reports..."
rm -rf tests/oc2ov_test/reports/*.html || true
# Clean up old logs
echo " - Removing old logs..."
rm -rf tests/oc2ov_test/logs/*.log || true
# Clean up pip cache (optional, saves disk space)
echo " - Cleaning pip cache..."
pip3 cache purge 2>/dev/null || echo " (pip cache not available or already clean)"
# Clean up old pytest cache
echo " - Removing pytest cache..."
rm -rf .pytest_cache || true
rm -rf tests/oc2ov_test/.pytest_cache || true
# Clean up __pycache__ directories
echo " - Removing __pycache__ directories..."
find tests/oc2ov_test -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
echo "✅ Cleanup completed"
- name: Debug - Start
run: |
echo "🚀 Job started at $(date)"
echo "Runner: $(hostname)"
echo "Working directory: $(pwd)"
echo "Python version: $(python3 --version 2>&1 || echo 'Python not found')"
echo "Environment variables:"
echo " - RUNNER_OS: ${{ runner.os }}"
echo " - GITHUB_REF: ${{ github.ref }}"
echo " - GITHUB_SHA: ${{ github.sha }}"
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
submodules: false
fetch-depth: 100
- name: Install OpenClaw plugin dependencies
run: |
cd examples/openclaw-plugin
npm install --production 2>&1 || npm install 2>&1 || true
- name: Upgrade OpenViking to latest main
run: |
echo "🔄 Upgrading OpenViking to latest main branch..."
# Make upgrade script executable
chmod +x tests/oc2ov_test/upgrade_openviking.sh
# Run upgrade script
bash tests/oc2ov_test/upgrade_openviking.sh
echo "✅ OpenViking upgrade completed"
# Wait for services to be fully ready
echo "⏳ Waiting for services to be ready..."
sleep 10
# Health check
echo "🏥 Performing health check..."
echo "Checking OpenViking server (port 1933)..."
for i in {1..10}; do
if curl -sf http://127.0.0.1:1933/health 2>/dev/null | grep -q "healthy"; then
echo "✅ OpenViking server is healthy"
break
else
echo "⏳ Attempt $i/10: OpenViking not ready, waiting..."
sleep 5
fi
done
echo "Checking OpenClaw gateway (port 18789)..."
for i in {1..10}; do
if ss -tuln 2>/dev/null | grep -q ":18789 "; then
echo "✅ OpenClaw gateway is listening on port 18789"
break
else
echo "⏳ Attempt $i/10: Gateway not ready, waiting..."
sleep 5
fi
done
echo "Checking a real OpenClaw JSON response..."
openclaw --version || true
cd tests/oc2ov_test
python3 utils/openclaw_cli_smoke.py \
--session-id "oc2ov-ci-smoke-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- name: Install test dependencies
run: |
echo "📦 Setting up Python virtual environment..."
cd tests/oc2ov_test
# Create virtual environment
python3 -m venv venv
echo "✅ Virtual environment created"
# Activate and install dependencies
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-html pytest-timeout
echo "✅ Dependencies installed in virtual environment"
- name: Create settings.py from example
run: |
echo "📝 Creating settings.py from settings.example.py..."
cd tests/oc2ov_test/config
# Check if settings.py exists
if [ -f "settings.py" ]; then
echo "✅ settings.py already exists"
else
# Copy settings.example.py to settings.py
cp settings.example.py settings.py
echo "✅ settings.py created from settings.example.py"
echo "⚠️ Note: Using default settings. For custom settings, manually create settings.py on the ECS node."
fi
- name: Run P0 tests
id: run-tests
run: |
echo "🧪 Starting P0 tests..."
cd tests/oc2ov_test
# Activate virtual environment
source venv/bin/activate
# Set PYTHONPATH to include both project root and tests/oc2ov_test
# This allows imports like:
# - 'from tests.base_cli_test import ...' (from project root)
# - 'from config.settings import ...' (from tests/oc2ov_test)
export PYTHONPATH="$(cd ../.. && pwd):$(pwd)"
echo "PYTHONPATH: $PYTHONPATH"
mkdir -p reports
pytest tests/p0 -v \
--html=reports/test_report_p0.html \
--self-contained-html \
--tb=short \
--timeout=3600
echo "✅ P0 tests completed"
continue-on-error: true
- name: Upload test reports
uses: actions/upload-artifact@v7
if: always()
with:
name: p0-test-reports-${{ github.run_id }}
path: |
tests/oc2ov_test/reports/test_report_p0.html
tests/oc2ov_test/logs/
retention-days: 30
- name: Check test results
if: steps.run-tests.outcome != 'success'
run: |
echo "::error::P0 tests failed! Please check the test report for details."
exit 1
- name: Test summary
if: success()
run: |
echo "::notice::P0 tests passed successfully! Ready for release."