mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
[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:
parent
5bbdc62ada
commit
d3b2089e89
3
pom.xml
3
pom.xml
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user