Trying to get CI for tests right.
Some checks failed
Tests / Frontend Tests (TypeScript + Vue + Yarn Berry) (push) Failing after 7m42s
Tests / Backend Tests (Python 3.13 + uv) (push) Successful in 15m25s

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-10-23 11:50:05 -04:00
parent d83880a5cd
commit 17a8ab1a06

View File

@@ -126,31 +126,15 @@ jobs:
echo "Creating virtual environment..."
uv venv .venv --python python3.13
# Activate environment and install dependencies
echo "Activating environment and installing dependencies..."
# Activate environment and install dev dependencies
echo "Installing project with dev dependencies..."
. .venv/bin/activate
# Try to install with detailed error handling
if uv pip install -e ".[dev]"; then
echo "Installation successful!"
else
echo "Installation failed, trying alternative approach..."
# Try installing dependencies individually
uv pip install pytest pytest-cov typeguard fastapi uvicorn ruff pyright
# Install current package in development mode without dependencies
uv pip install -e . --no-deps
fi
uv pip install -e ".[dev]"
# Verify installation
echo "Verifying Python environment..."
python --version
# Try to import and verify
if python -c "import backend; print(f'Backend version: {backend.__version__}')" 2>/dev/null; then
echo "Backend package imported successfully"
else
echo "Backend package import failed, but environment is set up"
fi
python -c "import backend; print(f'Backend version: {backend.__version__}')"
# Show installed packages
echo "Installed packages:"
@@ -164,27 +148,14 @@ jobs:
echo "=== Running Backend Tests ==="
# Check if we have tests directory
if [ -d tests ]; then
echo "Found tests directory, running pytest..."
# Run tests with coverage and typeguard if available
if python -m pytest tests/ -v --cov=backend --cov-report=term-missing 2>/dev/null; then
echo "Tests completed successfully with coverage"
else
echo "Coverage failed, trying basic pytest..."
if python -m pytest tests/ -v 2>/dev/null; then
echo "Basic tests completed successfully"
else
echo "Pytest failed, running simple test validation..."
python -c "exec(open('tests/test_basic.py').read()); test_basic(); print('✓ Basic test passed')"
fi
fi
else
echo "No tests directory found, running basic validation..."
python -c "print('✓ Python 3.13 + uv environment is working!')"
fi
# Run pytest with typeguard and coverage
python -m pytest tests/ -v \
--cov=backend \
--cov-report=term-missing \
--cov-report=xml \
--typeguard-packages=backend
echo "Backend environment validation complete!"
echo "Backend tests completed with typeguard and coverage!"
frontend-tests:
name: Frontend Tests (TypeScript + Vue + Yarn Berry)
@@ -255,72 +226,29 @@ jobs:
run: |
echo "=== Frontend Dependency Installation ==="
# Check if we have a real frontend directory or created a minimal one
if [ -f package.json ]; then
echo "Found package.json, proceeding with installation..."
# Initialize yarn berry and allow lockfile creation
yarn set version stable
# Initialize yarn berry and allow lockfile creation
yarn set version stable
# Configure yarn for faster, more reliable installation
echo "enableImmutableInstalls: false" > .yarnrc.yml
echo "nodeLinker: pnp" >> .yarnrc.yml
echo "compressionLevel: 0" >> .yarnrc.yml
echo "httpTimeout: 60000" >> .yarnrc.yml
echo "networkTimeout: 60000" >> .yarnrc.yml
# Configure yarn for faster, more reliable installation
echo "enableImmutableInstalls: false" > .yarnrc.yml
echo "nodeLinker: pnp" >> .yarnrc.yml
echo "compressionLevel: 0" >> .yarnrc.yml
echo "httpTimeout: 60000" >> .yarnrc.yml
echo "networkTimeout: 60000" >> .yarnrc.yml
# Add packageManager field to package.json to avoid warnings
if ! grep -q '"packageManager"' package.json; then
# Add packageManager field before the closing brace
sed -i '$ s/}/ "packageManager": "yarn@4.10.3",\n}/' package.json
fi
# Install dependencies with timeout and retry
echo "Starting yarn install (with 8-minute timeout)..."
timeout 480s yarn install --verbose || {
echo "Installation timed out or failed, trying minimal install..."
# Try with fewer dependencies if full install fails
yarn add vue typescript --timeout 120000 || echo "Minimal install also failed"
}
echo "Dependencies installation complete"
yarn list --depth=0 || echo "Package listing completed"
else
echo "No package.json found, creating minimal frontend setup for testing..."
# Create a proper package.json for testing using individual echo commands
echo '{' > package.json
echo ' "name": "frontend-test",' >> package.json
echo ' "version": "0.1.0",' >> package.json
echo ' "description": "Frontend testing environment",' >> package.json
echo ' "type": "module",' >> package.json
echo ' "scripts": {' >> package.json
echo ' "dev": "echo '\''dev script'\'',"' >> package.json
echo ' "build": "echo '\''build script'\'',"' >> package.json
echo ' "type-check": "echo '\''type-check script'\'',"' >> package.json
echo ' "test:unit": "echo '\''test script - all tests pass'\''"' >> package.json
echo ' },' >> package.json
echo ' "dependencies": {' >> package.json
echo ' "vue": "^3.3.0"' >> package.json
echo ' },' >> package.json
echo ' "devDependencies": {' >> package.json
echo ' "typescript": "^5.1.0",' >> package.json
echo ' "@vitejs/plugin-vue": "^4.3.0",' >> package.json
echo ' "vitest": "^0.34.0",' >> package.json
echo ' "vue-tsc": "^1.8.0"' >> package.json
echo ' }' >> package.json
echo '}' >> package.json
# Initialize yarn berry
yarn set version stable
echo "enableImmutableInstalls: false" > .yarnrc.yml
# Install the test dependencies
yarn install
echo "Minimal frontend setup complete"
# Add packageManager field to package.json to avoid warnings
if ! grep -q '"packageManager"' package.json; then
# Add packageManager field before the closing brace
sed -i '$ s/}/ "packageManager": "yarn@4.10.3",\n}/' package.json
fi
# Install all dependencies from package.json
echo "Installing dependencies from package.json..."
yarn install --verbose
echo "Dependencies installation complete"
yarn list --depth=0
- name: Verify TypeScript and Vue installation
working-directory: ./frontend
run: |
@@ -346,6 +274,8 @@ jobs:
working-directory: ./frontend
run: |
echo "=== Running Frontend Tests ==="
yarn test:unit || echo "Tests completed (may have used fallback script)"
echo "Frontend environment validation complete!"
# Run Vitest tests with coverage
yarn test:coverage
echo "✓ Frontend tests completed with coverage!"