Skip to content

adapt to non-tty DB output #353

adapt to non-tty DB output

adapt to non-tty DB output #353

Workflow file for this run

name: Test building and running dojo
on: push
jobs:
smoketest:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
tags: dojo-test
load: true
# cache-from: type=gha
# cache-to: type=gha,mode=max
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install test dependencies
run: pip install pytest pytest-dependency requests
- name: Run dojo
run: |
docker run \
--privileged \
-d \
-v ./dojo-test-data:/opt/pwn.college/data:shared \
-p 2222:22 -p 80:80 -p 443:443 \
--name dojo-test \
dojo-test
- name: Wait for services to build and start
run: |
docker exec dojo-test dojo wait
- name: Wait for services to be ready
timeout-minutes: 2
run: |
docker exec dojo-test dojo compose logs -f &
log_pid=$!
until [[ "$(docker exec dojo-test docker inspect --format='{{.State.Health.Status}}' ctfd)" == "healthy" ]]; do
sleep 1
done
kill $log_pid
exit 0
- name: Run tests against dojo
run: |
pytest -vrpP ./test || (docker exec dojo-test docker compose logs && false)