forked from loafle/openapi-generator-original
[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:
@@ -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
|
||||
Reference in New Issue
Block a user