Repository: OpenAPITools/openapi-generator

Issue #3286: Travis build failure (Python Flask tests)
Created: 2019-07-05T16:19:21Z
Description
Travis build failure with the following error message:
Using /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/idna-2.8-py3.6.egg
Searching for Werkzeug==0.15.4
Best match: Werkzeug 0.15.4
Adding Werkzeug 0.15.4 to easy-install.pth file

Using /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages
Searching for Click==7.0
Best match: Click 7.0
Adding Click 7.0 to easy-install.pth file

Using /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages
Searching for itsdangerous==1.1.0
Best match: itsdangerous 1.1.0
Adding itsdangerous 1.1.0 to easy-install.pth file

Using /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages
Finished processing dependencies for openapi-server==1.0.0
GLOB sdist-make: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/setup.py
py3 create: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3
py3 installdeps: -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/requirements.txt, -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/test-requirements.txt
py3 inst: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/.tmp/package/1/openapi_server-1.0.0.zip
py3 installed: certifi==2019.6.16,chardet==3.0.4,Click==7.0,clickclick==1.2.2,connexion==2.0.0,coverage==4.5.3,Flask==1.1.0,Flask-Testing==0.6.1,idna==2.8,importlib-metadata==0.18,inflection==0.3.1,itsdangerous==1.1.0,Jinja2==2.10.1,jsonschema==2.6.0,MarkupSafe==1.1.1,nose==1.3.7,openapi-server==1.0.0,openapi-spec-validator==0.2.7,pluggy==0.12.0,py==1.8.0,python-dateutil==2.6.0,PyYAML==5.1.1,randomize==0.14,requests==2.22.0,six==1.12.0,swagger-ui-bundle==0.0.2,urllib3==1.25.3,Werkzeug==0.15.4,zipp==0.5.1
py3 run-test-pre: PYTHONHASHSEED='2015464316'
py3 run-test: commands[0] | nosetests
E
======================================================================
ERROR: Failure: ImportError (cannot import name 'json_available')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/imp.py", line 245, in load_module
    return load_package(name, filename)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/imp.py", line 217, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/openapi_server/test/__init__.py", line 4, in <module>
    from flask_testing import TestCase
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/flask_testing/__init__.py", line 13, in <module>
    from .utils import TestCase, LiveServerTestCase
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/lib/python3.6/site-packages/flask_testing/utils.py", line 32, in <module>
    from flask import json_available, templating, template_rendered
ImportError: cannot import name 'json_available'

----------------------------------------------------------------------
Ran 1 test in 0.639s

FAILED (errors=1)
ERROR: InvocationError for command /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/bin/nosetests (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py3: commands failed
make: *** [test-all] Error 1
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (nose-test) on project PythonFlaskConnexionTests: Command execution failed. Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :PythonFlaskConnexionTests

Ref: https://travis-ci.org/OpenAPITools/openapi-generator/builds/554746558
Likely due to change in the build image.
We'll comment out the Python Flask test for the time being.
openapi-generator version
Latest master
Suggest a fix/enhancement
If anyone wants to help with this, please reply to let us know. Thanks.

Duplicate issue #4823: Python (2.x) Flask tests in Travis failed 
Created: 2019-12-18T01:30:26Z
Using /home/travis/virtualenv/python3.6.9/lib/python3.6/site-packages
Finished processing dependencies for openapi-server==1.0.0
GLOB sdist-make: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/setup.py
py27 create: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27
py27 installdeps: -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/requirements.txt, -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/test-requirements.txt
py27 inst: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/.tmp/package/1/openapi_server-1.0.0.zip
py27 installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.,attrs==19.3.0,certifi==2019.11.28,chardet==3.0.4,Click==7.0,clickclick==1.2.2,configparser==4.0.2,connexion==2.5.0,contextlib2==0.6.0.post1,coverage==5.0,Flask==1.1.1,Flask-Testing==0.6.1,functools32==3.2.3.post2,idna==2.8,importlib-metadata==1.3.0,inflection==0.3.1,itsdangerous==1.1.0,Jinja2==2.10.3,jsonschema==3.2.0,MarkupSafe==1.1.1,more-itertools==5.0.0,nose==1.3.7,openapi-server==1.0.0,openapi-spec-validator==0.2.8,pathlib2==2.3.5,pluggy==0.13.1,py==1.8.0,pyrsistent==0.15.6,python-dateutil==2.8.1,PyYAML==5.2,randomize==0.14,requests==2.22.0,scandir==1.10.0,six==1.13.0,swagger-ui-bundle==0.0.6,typing==3.7.4.1,urllib3==1.25.7,Werkzeug==0.16.0,zipp==0.6.0
py27 run-test-pre: PYTHONHASHSEED='605076116'
py27 run-test: commands[0] | nosetests
E
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (abstract.py, line 32))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/openapi_server/test/__init__.py", line 3, in <module>
    import connexion
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/connexion/__init__.py", line 5, in <module>
    from .apis import AbstractAPI  # NOQA
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/connexion/apis/__init__.py", line 1, in <module>
    from .abstract import AbstractAPI  # NOQA
  File "/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/local/lib/python2.7/site-packages/connexion/apis/abstract.py", line 32
    class AbstractAPI(metaclass=AbstractAPIMeta):
                               ^
SyntaxError: invalid syntax

----------------------------------------------------------------------
Ran 1 test in 0.058s

FAILED (errors=1)
ERROR: InvocationError for command /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py27/bin/nosetests (exited with code 1)
py3 create: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/py3
py3 installdeps: -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/requirements.txt, -r/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/test-requirements.txt
py3 inst: /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask-python2/.tox/.tmp/package/1/openapi_server-1.0.0.zip
py3 installed: attrs==19.3.0,certifi==2019.11.28,chardet==3.0.4,Click==7.0,clickclick==1.2.2,connexion==2.5.0,coverage==5.0,Flask==1.1.1,Flask-Testing==0.6.1,idna==2.8,importlib-metadata==1.3.0,inflection==0.3.1,itsdangerous==1.1.0,Jinja2==2.10.3,jsonschema==3.2.0,MarkupSafe==1.1.1,more-itertools==8.0.2,nose==1.3.7,openapi-server==1.0.0,openapi-spec-validator==0.2.8,pluggy==0.13.1,py==1.8.0,pyrsistent==0.15.6,python-dateutil==2.8.1,PyYAML==5.2,randomize==0.14,requests==2.22.0,six==1.13.0,swagger-ui-bundle==0.0.6,typing==3.7.4.1,urllib3==1.25.7,Werkzeug==0.16.0,zipp==0.6.0
py3 run-test-pre: PYTHONHASHSEED='605076116'
py3 run-test: commands[0] | nosetests
S....SSS...SSSS....S
----------------------------------------------------------------------
Ran 20 tests in 5.480s

OK (SKIP=9)
___________________________________ summary ____________________________________
ERROR:   py27: commands failed
  py3: commands succeeded
Makefile:20: recipe for target 'test-all' failed
make: *** [test-all] Error 1
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (nose-test) on project PythonFlaskConnexionTestsPython2: Command execution failed. Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :PythonFlaskConnexionTestsPython2

Ref: https://travis-ci.org/OpenAPITools/openapi-generator/builds/625992917
We've commented out the tests in pom.xml for the time being.

Closing comment (2019-12-18T09:00:16Z): @aadibajpai can you please take a look when you've time? It could be similar to #3286

Sorry, I'm totally plagued by other stuff now. No time at all :(