diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b4947fa3ded0d2471a60cf3cc0931811240574b..fc6927d29749f9e72b2607f5fa944603773d8b84 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ stages: - prepare - test - build + - test-build - release prepare: @@ -107,6 +108,52 @@ 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 /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: # Use the official docker image. image: docker:latest