Skip to content

Add system tags tools #57

Add system tags tools

Add system tags tools #57

name: Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test-integration:
name: NC ${{ matrix.nextcloud-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nextcloud-version: ["32", "33"]
services:
nextcloud:
image: nextcloud:${{ matrix.nextcloud-version }}
env:
SQLITE_DATABASE: nextcloud
NEXTCLOUD_ADMIN_USER: admin
NEXTCLOUD_ADMIN_PASSWORD: admin
ports:
- 8080:80
options: >-
--health-cmd "curl -f http://localhost/status.php || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 30
--health-start-period 60s
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Wait for Nextcloud
run: |
for i in $(seq 1 60); do
if curl -sf http://localhost:8080/status.php | python3 -c "import sys,json; sys.exit(0 if json.load(sys.stdin)['installed'] else 1)" 2>/dev/null; then
echo "Nextcloud is ready"
break
fi
echo "Waiting... ($i)"
sleep 3
done
- name: Configure Nextcloud for testing
run: |
NC_CONTAINER=${{ job.services.nextcloud.id }}
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ config:system:set ratelimit_protection_enabled --value=false --type=boolean"
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ config:system:set auth.bruteforce.protection.enabled --value=false --type=boolean"
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ config:system:set loglevel --value=0 --type=integer"
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ app:install spreed" || echo "spreed already installed"
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ app:install admin_notifications" || echo "admin_notifications already installed"
docker exec $NC_CONTAINER su -s /bin/bash www-data -c "php occ app:list" | head -30
- name: Run integration tests
env:
NEXTCLOUD_URL: http://localhost:8080
NEXTCLOUD_USER: admin
NEXTCLOUD_PASSWORD: admin
run: pytest tests/integration/ -v -m integration --cov=nextcloud_mcp --cov-report=xml:coverage-integration.xml
- name: Upload coverage
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5
with:
files: coverage-integration.xml
flags: integration,nc${{ matrix.nextcloud-version }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Dump Nextcloud logs on failure
if: failure()
run: |
docker exec ${{ job.services.nextcloud.id }} cat /var/www/html/data/nextcloud.log 2>/dev/null | tail -50 || echo "No logs found"