Commit c00f5561 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Merge branch 'feature/12-schemathesis' into 'master'

Integrate schemathesis tests into CI

See merge request !6
parents 902b4f0b 71367a11
Pipeline #1866 failed with stages
in 28 minutes and 14 seconds
...@@ -23,6 +23,7 @@ stages: ...@@ -23,6 +23,7 @@ stages:
- prepare - prepare
- test - test
- build - build
- test-build
- release - release
prepare: prepare:
...@@ -107,6 +108,52 @@ docker: ...@@ -107,6 +108,52 @@ docker:
only: only:
- master - 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
# https://stackoverflow.com/questions/71228282/could-not-resolve-host-when-trying-to-access-service-in-gitlab
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: ""
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: docker-hub-push:
# Use the official docker image. # Use the official docker image.
image: docker:latest 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