Enhancements intergration-test of python client

This commit is contained in:
geekerzp 2015-07-06 18:39:43 +08:00
parent 23dfac0194
commit c88c85a317
6 changed files with 74 additions and 35 deletions

3
.gitignore vendored
View File

@ -45,3 +45,6 @@ samples/client/petstore/php/SwaggerClient-php/vendor/
samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/
samples/client/petstore/python/.projectile
samples/client/petstore/python/.venv/

View File

@ -0,0 +1,12 @@
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- pip install . --use-mirrors
- pip install -r dev-requirements.txt --use-mirrors
script:
- nosetests

View File

@ -1,22 +1,9 @@
#!/bin/sh
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
virtualenv:
ifndef VIRTUAL_ENV
$(error Must be run inside of a virtualenv\
http://docs.python-guide.org/en/latest/dev/virtualenvs/)
endif
setup: virtualenv $(SETUP_OUT)
$(SETUP_OUT): setup.py setup.cfg
python setup.py develop
touch $(SETUP_OUT)
$(REQUIREMENTS_OUT): $(REQUIREMENTS_FILE)
pip install -r $(REQUIREMENTS_FILE) | tee -a $(REQUIREMENTS_OUT)
python setup.py develop
VENV=.venv
clean:
rm -rf $(REQUIREMENTS_OUT)
@ -26,12 +13,8 @@ clean:
find . -name "*.py[oc]" -delete
find . -name "__pycache__" -delete
requirements: setup $(REQUIREMENTS_OUT)
test: clean requirements
nosetests
test-all: clean requirements
tox
test: clean
sh ./test.sh
test-all: clean
sh ./test-all.sh

View File

@ -26,6 +26,20 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>pip-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>pip</executable>
<arguments>
<argument>install</argument>
<argument>virtualenv</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>nose-test</id>
<phase>integration-test</phase>
@ -44,14 +58,3 @@
</plugins>
</build>
</project>

View File

@ -0,0 +1,19 @@
#!/bin/sh
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
VENV=.venv
### set virtualenv
if [ -z "$VIRTUAL_ENV" ]; then
virtualenv $VENV --no-site-packages
source $VENV/bin/activate
fi
### install dependencies
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
python setup.py develop
### run tests
tox

View File

@ -0,0 +1,19 @@
#!/bin/sh
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
VENV=.venv
### set virtualenv
if [ -z "$VIRTUAL_ENV" ]; then
virtualenv $VENV --no-site-packages
source $VENV/bin/activate
fi
### install dependencies
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
python setup.py develop
### run tests
nosetests