[python-fastapi] Fixed integration tests (#9771)

* [python-fastapi] Fixed integration tests

Currently, it is required to use python 3.7 to make
python-fastapi generator work. This version is already
set in the generated Dockerfile. Thus, it makes sense to
build this image. Spotify's docker maven plugin can be
used to build the docker image.

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* fixup! [python-fastapi] Fixed integration tests

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
This commit is contained in:
Nikita Vakula 2021-06-16 09:49:02 +02:00 committed by GitHub
parent 5bbdc62ada
commit d3b2089e89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 42 deletions

View File

@ -1187,8 +1187,7 @@
<!-- servers -->
<module>samples/server/petstore/python-aiohttp</module>
<module>samples/server/petstore/python-aiohttp-srclayout</module>
<!-- comment out due to errors in the ci
<module>samples/server/petstore/python-fastapi</module>-->
<module>samples/server/petstore/python-fastapi</module>
<module>samples/server/petstore/python-flask</module>
<!-- TODO: will move these to Github action
<module>samples/server/petstore/php-slim4</module>

View File

@ -22,19 +22,16 @@
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
<goal>build</goal>
</goals>
<configuration>
<executable>./test_python3.sh</executable>
</configuration>
</execution>
</executions>
</plugin>

View File

@ -1,33 +0,0 @@
#!/bin/bash
set -e
REQUIREMENTS_FILE=requirements.txt
REQUIREMENTS_OUT=requirements.txt.log
SETUP_OUT=*.egg-info
VENV=.venv
DEACTIVE=false
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
### set virtualenv
if [ -z "$VIRTUAL_ENV" ]; then
virtualenv $VENV --no-site-packages --always-copy --python python3
source $VENV/bin/activate
DEACTIVE=true
fi
### install dependencies
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
### run tests
PYTHONPATH=src pytest tests
### static analysis of code
#flake8 --show-source src/
### deactivate virtualenv
if [ $DEACTIVE == true ]; then
deactivate
fi