Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

Create repo2pdf.ignore #27

Create repo2pdf.ignore

Create repo2pdf.ignore #27

Workflow file for this run

name: Test Suite
on:
push:
branches: [ main]
pull_request:
branches: [ main]
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Build event service
run: |
cd event
docker build -t 3lips-event-test .
- name: Run unit tests
run: |
docker run --rm -v $(pwd)/event:/app -v $(pwd)/tests/unit:/app/tests/unit -w /app 3lips-event-test python -m pytest tests/unit/ -v
integration-tests:
name: Puppeteer Integration Tests
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Puppeteer
run: |
npm install puppeteer
- name: Start test services
run: |
cd tests
docker compose -f docker-compose.ci.yml up -d
# Wait for services to be ready (longer wait for nginx and all services)
sleep 45
- name: Verify services are running
run: |
chmod +x tests/verify-services.sh
./tests/verify-services.sh
# Also verify mock services are responding
echo "πŸ” Checking mock services..."
for port in 8001 8002 8003; do
if curl -s -f http://localhost:$port > /dev/null; then
echo "βœ… Mock service on port $port is responding"
else
echo "❌ Mock service on port $port is not responding"
# Show what's actually running
docker ps
exit 1
fi
done
- name: Run Puppeteer smoke test
run: |
node -e "
const puppeteer = require('puppeteer');
const fs = require('fs');
async function runSmokeTest() {
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
console.log('πŸš€ Running 3lips smoke test...');
let passed = 0;
let failed = 0;
function addCheck(name, success, details = '') {
if (success) {
passed++;
console.log(\`βœ… \${name}\`);
} else {
failed++;
console.log(\`❌ \${name}: \${details}\`);
}
}
try {
console.log('🌐 Test 1: Page loads');
await page.goto('http://localhost:5000', { waitUntil: 'networkidle0' });
addCheck('Page loads', true);
console.log('🏷️ Test 2: Correct title');
const title = await page.title();
const hasCorrectTitle = title && title.includes('3lips');
addCheck('Correct title', hasCorrectTitle, hasCorrectTitle ? title : \`Got: \${title}\`);
console.log('πŸ“‹ Test 3: Form exists');
const hasForm = await page.\$('form') !== null;
addCheck('Form exists', hasForm, hasForm ? 'Found' : 'Missing form element');
console.log('▢️ Test 4: API button exists');
const hasApiButton = await page.\$('#buttonApi') !== null;
addCheck('API button exists', hasApiButton, hasApiButton ? 'Found' : 'Missing #buttonApi');
console.log('πŸ—ΊοΈ Test 5: Map button exists');
const hasMapButton = await page.\$('#buttonMap') !== null;
addCheck('Map button exists', hasMapButton, hasMapButton ? 'Found' : 'Missing #buttonMap');
console.log('πŸ“Έ Test 6: Take screenshot');
await page.screenshot({ path: 'smoke-test-result.png' });
addCheck('Screenshot captured', true, 'smoke-test-result.png');
const allPassed = failed === 0;
console.log(\`\\nπŸ“Š Smoke Test Results:\`);
console.log(\`βœ… Passed: \${passed}\`);
console.log(\`❌ Failed: \${failed}\`);
console.log(\`🎯 Overall: \${allPassed ? 'PASS' : 'FAIL'}\`);
if (allPassed) {
console.log('πŸŽ‰ 3lips is working correctly!');
} else {
console.log('⚠️ Issues detected - check failed tests above');
process.exit(1);
}
} catch (error) {
console.error('πŸ’₯ Smoke test failed with error:', error.message);
process.exit(1);
} finally {
await browser.close();
}
}
runSmokeTest();
"
- name: Test API service homepage
run: |
# Wait a moment for services to be fully ready
sleep 10
# Test that API service homepage is responding
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5000/)
if [ "$response" -eq "200" ]; then
echo "βœ… API service homepage is responding"
# Also test that the page contains expected content
content=$(curl -s http://localhost:5000/)
if echo "$content" | grep -q "3lips"; then
echo "βœ… Homepage contains expected content"
else
echo "❌ Homepage doesn't contain expected content"
exit 1
fi
else
echo "❌ API service returned HTTP $response"
exit 1
fi
- name: Test Map endpoint
run: |
# Test that Cesium service is accessible
curl -f http://localhost:8080 || exit 1
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-screenshots
path: |
smoke-test-result.png
tests/logs/
- name: Clean up test services
if: always()
run: |
cd tests
docker compose -f docker-compose.ci.yml down -v