tcalmant / python-javaobj

Extended fork of python-javaobj from http://code.google.com/p/python-javaobj/
Apache License 2.0
81 stars 19 forks source link

tox maven build failure #7

Closed voetsjoeba closed 8 years ago

voetsjoeba commented 8 years ago

Trying to simply run the test cases, I ran "tox" in the project root folder and got this output:

vmuser@vm:~/python-javaobj$ tox
GLOB sdist-make: /home/vmuser/python-javaobj/setup.py
py27 create: /home/vmuser/python-javaobj/.tox/py27
py27 installdeps: nose, coverage
py27 inst: /home/vmuser/python-javaobj/.tox/dist/javaobj-py3-0.2.0.zip
py27 installed: coverage==4.2,javaobj-py3==0.2.0,nose==1.3.7
py27 runtests: PYTHONHASHSEED='1132819322'
py27 runtests: commands[0] | nosetests --with-coverage tests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.240 s
[INFO] Finished at: 2016-08-22T15:45:40+02:00
[INFO] Final Memory: 5M/85M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/NoGoalSpecifiedException
...

Looks like this happens because tests/tests.py invokes maven this way:

subprocess.call(['mvn', 'test'], shell=True)

instead of

subprocess.call("mvn test", shell=True)

Switching to the latter works.

tcalmant commented 8 years ago

I can't reproduce the bug, neither on Python 2.7.12 nor 3.5.1. I'll commit the patch anyway, as it doesn't cause any regression.

voetsjoeba commented 8 years ago

Might depend on your system's default shell and how it interprets extra arguments. subprocess.call(["mvn", "test"], shell=True) invokes /bin/sh -c mvn test, in which the extra "test" argument gets ignored.