Commit fc35fc5b authored by robwa's avatar robwa
Browse files

feat: Use schemathesis to test scheme against tank build

parent 902b4f0b
......@@ -23,6 +23,7 @@ stages:
- prepare
- test
- build
- test-build
- release
prepare:
......@@ -107,6 +108,49 @@ docker:
only:
- master
test-scheme:
stage: test-build
needs:
- job: build-openapi-3-scheme
artifacts: true
image:
name: schemathesis/schemathesis:stable
entrypoint: [""]
services:
- name: postgres:13
alias: postgres
- name: gitlab.servus.at:5050/aura/tank:master
entrypoint: ["/bin/bash"]
command:
- '-c'
- |
# make sure postgres is up before starting tank
while true; do
timeout 0.25 cat >/dev/null 2>&1 </dev/tcp/postgres/5432
if [ "$?" = 124 ]; then break; fi
done
# disable authentication
sed '/auth:/q' /etc/aura/tank.yaml | head -n-1 >/tmp/tank.yaml
/usr/local/bin/tank --config /tmp/tank.yaml run --listen :"$TANK_PORT"
alias: tank
variables:
POSTGRES_DB: tank
POSTGRES_USER: tank
POSTGRES_PASSWORD: aura
TANK_DB_HOST: postgres
TANK_PORT: 8040
# Enable per-build-network so that service aliases are also
# usable in the service containers themselves.
FF_NETWORK_PER_BUILD: 1
parallel:
matrix:
# see https://schemathesis.readthedocs.io/en/stable/cli.html#cmdoption-schemathesis-run-c
- CHECKS: status_code_conformance
- CHECKS: response_headers_conformance
- CHECKS: response_schema_conformance
script:
- schemathesis run -c "$CHECKS" -b http://tank:"$TANK_PORT" --hypothesis-suppress-health-check too_slow api/docs/openapi/openapi.yaml
docker-hub-push:
# Use the official docker image.
image: docker:latest
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment