Add tester gw for each commit #185 PR #188 #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tester for Local proctoring | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| tester: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Python packages | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install -r tests/requirements.txt | |
| - name: Install playwright packages | |
| run: playwright install | |
| - name: Start server | |
| run: docker compose -f server/docker-compose.yml up -d | |
| - name: Check server availability | |
| run: | | |
| attempt=1 | |
| max_attempts=10 | |
| sleep_time=5 | |
| while [ $attempt -le $max_attempts ]; do | |
| echo "Проверка доступности сервера, попытка $attempt" | |
| if curl http://localhost:5000 --output /dev/null --fail --head --silent; then | |
| echo "Сервер запущен!" | |
| exit 0 | |
| else | |
| echo "Сервер не отвечает, пауза между попытками $sleep_time секунд" | |
| sleep $sleep_time | |
| ((attempt++)) | |
| fi | |
| done | |
| echo "Сервер недоступен после $max_attempts попыток" | |
| exit 1 | |
| - name: Run server tests | |
| run: | | |
| chmod +x tests/run_server_tests.sh | |
| cd tests && ./run_server_tests.sh | |
| - name: Run client tests | |
| run: | | |
| chmod +x tests/run_client_tests.sh | |
| cd tests && ./run_client_tests.sh | |
| - name: Stop server | |
| if: always() | |
| run: docker compose -f server/docker-compose.yml down |