Skip to content

Merge pull request #119 from muchdogesec/remove-unnecessary-service #9

Merge pull request #119 from muchdogesec/remove-unnecessary-service

Merge pull request #119 from muchdogesec/remove-unnecessary-service #9

Workflow file for this run

name: Schemathesis Test
on:
push:
branches:
- main
pull_request:
jobs:
test-schema-thesis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set .env for docker-compose
run: |
echo 'CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP=1' > .env
echo 'POSTGRES_HOST=pgdb' >> .env
echo 'POSTGRES_DB=postgres' >> .env
echo 'POSTGRES_USER=postgres' >> .env
echo 'POSTGRES_PASSWORD=postgres' >> .env
echo "DJANGO_ALLOWED_HOSTS=*" >> .env
cat tests/st/.env.schemathesis >> .env
cp tests/st/docker-compose.yml arango-compose.yml
- name: Start docker-compose
uses: hoverkraft-tech/compose-action@v2.0.2
with:
compose-file: |
arango-compose.yml
docker-compose.yml
compose-flags:
--env-file .env
-p ctibutler-action
- name: sleep
run: echo "waiting 30 seconds for ctibutler to start" && sleep 30
- name: Get IP addresses
id: get_ip
run: |
IP_ADDRESS=$(docker network inspect -f '{{range.IPAM.Config}}{{.Gateway}}{{end}}' ctibutler-action_default)
echo "ip_address=$IP_ADDRESS" >> "$GITHUB_OUTPUT"
echo "IP_ADDRESS=$IP_ADDRESS" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
- name: upload data to endpoints and test all endpoints
id: test-endpoints
run: |
pip install -r tests/requirements.txt
export CTIBUTLER_URL=http://${{ steps.get_ip.outputs.IP_ADDRESS }}:8006/
pytest tests/
- name: run schemathesis
uses: schemathesis/action@v1
env:
SCHEMATHESIS_HOOKS: tests.st.hooks
with:
schema: http://${{ steps.get_ip.outputs.IP_ADDRESS }}:8006/api/schema/
checks: all
wait-for-schema: '30'
args: '--generation-allow-x00 false'