diff --git a/.gitignore b/.gitignore index 3643ce4..2dfb355 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pydantic/*.so .auto-format /sandbox/ /.ghtopdep_cache/ +/fastapi/ diff --git a/.travis.yml b/.travis.yml index fdd4c35..b2d52b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,6 +93,12 @@ jobs: - make test env: - 'DEPS=no' + + - stage: test + python: 3.7 + name: 'Test FastAPI' + script: + - make test-fastapi - stage: test python: 3.7 diff --git a/Makefile b/Makefile index 84a2460..d9423ad 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,7 @@ clean: rm -rf site rm -rf docs/_build rm -rf docs/.changelog.md docs/.version.md docs/.tmp_schema_mappings.html + rm -rf fastapi/test.db .PHONY: docs docs: @@ -108,3 +109,10 @@ publish: docs zip -r site.zip site @curl -H "Content-Type: application/zip" -H "Authorization: Bearer ${NETLIFY}" \ --data-binary "@site.zip" https://api.netlify.com/api/v1/sites/pydantic-docs.netlify.com/deploys + +fastapi: + git clone https://github.com/tiangolo/fastapi.git + +.PHONY: test-fastapi +test-fastapi: install fastapi + bash tests/test-fastapi.sh diff --git a/changes/1075-tiangolo.md b/changes/1075-tiangolo.md new file mode 100644 index 0000000..7de811a --- /dev/null +++ b/changes/1075-tiangolo.md @@ -0,0 +1 @@ +Run FastAPI tests during Pydantic's CI tests diff --git a/tests/test-fastapi.sh b/tests/test-fastapi.sh new file mode 100644 index 0000000..bfdc78a --- /dev/null +++ b/tests/test-fastapi.sh @@ -0,0 +1,14 @@ +#! /usr/bin/env bash + +set -x +set -e + +cd fastapi +git fetch --tags +latest_tag_commit=$(git rev-list --tags --max-count=1) +latest_tag=$(git describe --tags "${latest_tag_commit}") +git checkout "${latest_tag}" +pip install -U flit +flit install + +PYTHONPATH=./docs/src pytest