Project

General

Profile

Bug #42469

mgr/dashboard: Running Python unit tests fails

Added by Volker Theile 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Category:
dashboard/build
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

Running the Python unit tests located at /src/pybind/mgr/dashboard/tests according to the HACKING.rst fails.

$ ../../../script/run_tox.sh --tox-env py27,py3,lint,check

This results in

╭─root@ceph-master-docker /ceph/src/pybind/mgr/dashboard ‹issue_42445_grafana_ssl› 
╰─# ../../../script/run_tox.sh --tox-env py27,py3,lint,check
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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: tox in /ceph/build/lib/python2.7/site-packages (2.9.1)
Requirement already satisfied: virtualenv>=1.11.2; python_version != "3.2" in /ceph/build/lib/python2.7/site-packages (from tox) (15.1.0)
Requirement already satisfied: py>=1.4.17 in /ceph/build/lib/python2.7/site-packages (from tox) (1.5.2)
Requirement already satisfied: six in /ceph/build/lib/python2.7/site-packages (from tox) (1.11.0)
Requirement already satisfied: pluggy<1.0,>=0.3.0 in /ceph/build/lib/python2.7/site-packages (from tox) (0.6.0)
WARNING: You are using pip version 19.2.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
py27 create: /ceph/src/pybind/mgr/dashboard/.tox/py27
py27 installdeps: -r requirements.txt, -c constraints.txt, -r requirements-test.txt
ERROR: invocation failed (exit code 1), logfile: /ceph/src/pybind/mgr/dashboard/.tox/py27/log/py27-1.log
ERROR: actionid: py27
msg: getenv
cmdargs: ['/ceph/src/pybind/mgr/dashboard/.tox/py27/bin/pip', 'install', '-r requirements.txt', '-c constraints.txt', '-r requirements-test.txt']

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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ' constraints.txt'

ERROR: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-test.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/py27/bin/pip install -r requirements.txt -c constraints.txt -r requirements-test.txt (see /ceph/src/pybind/mgr/dashboard/.tox/py27/log/py27-1.log)', 1)
py3 create: /ceph/src/pybind/mgr/dashboard/.tox/py3
py3 installdeps: -r requirements.txt, -c constraints.txt, -r requirements-test.txt
ERROR: invocation failed (exit code 1), logfile: /ceph/src/pybind/mgr/dashboard/.tox/py3/log/py3-1.log
ERROR: actionid: py3
msg: getenv
cmdargs: ['/ceph/src/pybind/mgr/dashboard/.tox/py3/bin/pip', 'install', '-r requirements.txt', '-c constraints.txt', '-r requirements-test.txt']

ERROR: Could not open requirements file: [Errno 2] No such file or directory: ' constraints.txt'

ERROR: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-test.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/py3/bin/pip install -r requirements.txt -c constraints.txt -r requirements-test.txt (see /ceph/src/pybind/mgr/dashboard/.tox/py3/log/py3-1.log)', 1)
lint create: /ceph/src/pybind/mgr/dashboard/.tox/lint
lint installdeps: -r requirements.txt, -c constraints.txt, -r requirements-lint.txt
ERROR: invocation failed (exit code 1), logfile: /ceph/src/pybind/mgr/dashboard/.tox/lint/log/lint-1.log
ERROR: actionid: lint
msg: getenv
cmdargs: ['/ceph/src/pybind/mgr/dashboard/.tox/lint/bin/pip', 'install', '-r requirements.txt', '-c constraints.txt', '-r requirements-lint.txt']

ERROR: Could not open requirements file: [Errno 2] No such file or directory: ' constraints.txt'

ERROR: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-lint.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/lint/bin/pip install -r requirements.txt -c constraints.txt -r requirements-lint.txt (see /ceph/src/pybind/mgr/dashboard/.tox/lint/log/lint-1.log)', 1)
check 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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,-f /ceph/src/pybind/mgr/dashboard/wheelhouse,six==1.11.0
check runtests: PYTHONHASHSEED='554040970'
check runtests: commands[0] | python ci/check_grafana_uids.py frontend/src/app ../../../../monitoring/grafana/dashboards
Checking Grafana dashboards UIDs: OK
____________________________________________________________ summary _____________________________________________________________
ERROR:   py27: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-test.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/py27/bin/pip install -r requirements.txt -c constraints.txt -r requirements-test.txt (see /ceph/src/pybind/mgr/dashboard/.tox/py27/log/py27-1.log)', 1)
ERROR:   py3: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-test.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/py3/bin/pip install -r requirements.txt -c constraints.txt -r requirements-test.txt (see /ceph/src/pybind/mgr/dashboard/.tox/py3/log/py3-1.log)', 1)
ERROR:   lint: could not install deps [-r requirements.txt, -c constraints.txt, -r requirements-lint.txt]; v = InvocationError('/ceph/src/pybind/mgr/dashboard/.tox/lint/bin/pip install -r requirements.txt -c constraints.txt -r requirements-lint.txt (see /ceph/src/pybind/mgr/dashboard/.tox/lint/log/lint-1.log)', 1)
  check: commands succeeded

History

#1 Updated by Volker Theile 5 months ago

To me it looks like the pip command line arguments are the reason for this. When i remove the blanks for the deps in the tox.ini file i can successfully run the script.

Fails:

[base]
deps =
    -r requirements.txt
    -c constraints.txt

[base-test]
deps =
    -r requirements-test.txt

[base-lint]
deps =
    -r requirements-lint.txt

Works:

[base]
deps =
    -rrequirements.txt
    -cconstraints.txt

[base-test]
deps =
    -rrequirements-test.txt

[base-lint]
deps =
    -rrequirements-lint.txt

The Python venv created by tox uses the latest pip version which is 19.3.1.

╭─root@ceph-master-docker / 
╰─# source /ceph/src/pybind/mgr/dashboard/.tox/py27/bin/activate
(py27) ╭─root@ceph-master-docker / 
╰─# pip list
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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package    Version
---------- -------
pip        19.3.1 
setuptools 41.4.0 
wheel      0.33.6 
(py27) ╭─root@ceph-master-docker / 

#2 Updated by Sebastian Wagner 5 months ago

  • Status changed from New to 12

Yep. Noticed the same thing.

#3 Updated by Sebastian Wagner 5 months ago

  • Status changed from 12 to Fix Under Review
  • Assignee changed from Alfonso Martínez to Sebastian Wagner
  • Pull request ID set to 31246

#4 Updated by Sebastian Wagner 5 months ago

cmdargs: ['/home/sebastian/Repos/ceph/src/pybind/mgr/dashboard/.tox/lint/bin/pip', 'install', '-r requirements.txt', '-c constraints.txt', '-r requirements-lint.txt']                                                                                                                      

ERROR: Could not open requirements file: [Errno 2] Datei oder Verzeichnis nicht gefunden: ' constraints.txt'                                                                                                                                                                                

looks like tox invokes pip like so:

LANG=C /home/sebastian/Repos/ceph/src/pybind/mgr/dashboard/.tox/py3/bin/pip install "-r requirements.txt" "-c constraints.txt" "-r requirements-test.txt" 
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ' constraints.txt'

#5 Updated by Lenz Grimmer 5 months ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF