Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths provided by -n are not normalized #364

Closed
stephenfin opened this issue Aug 28, 2024 · 0 comments · Fixed by #365
Closed

Paths provided by -n are not normalized #364

stephenfin opened this issue Aug 28, 2024 · 0 comments · Fixed by #365
Labels

Comments

@stephenfin
Copy link
Contributor

Issue description

I attempted to run all tests in a file using the following:

tox -e functional-py310 -- -n nova//tests/functional/api_sample_tests/test_hosts.py

which run the following under the hood:

stestr --test-path=./nova/tests/functional run -n nova//tests/functional/api_sample_tests/test_hosts.py

Expected behavior and actual behavior

This should have run the tests in the file. Instead, it exited with this error:

==============================                                                                                                                                                    
Failed 1 tests - output below:                                                                                                                                                    
==============================                                                                                                                                                    
                                                                                                                                                                                  
unittest.loader._FailedTest.                                                                                                                                                      
----------------------------                                                                                                                                                      
                                                                                                                                                                                  
Captured traceback:                                                                                                                                                               
~~~~~~~~~~~~~~~~~~~                         
    ImportError: Failed to import test module: 
Traceback (most recent call last):
  File "/usr/lib64/python3.10/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
ModuleNotFoundError: No module named 'nova.'

nova//tests/functional/api_sample_tests/test_hosts.py normalizes to nova/tests/functional/api_sample_tests/test_hosts.py (at least in Vim, Bash, and elsewhere) and stestr should be doing the same.

Steps to reproduce the problem

Per above.

Specifications like the version of the project, operating system, or hardware

n/a

System information

  • OS: [e.g. Windows10, openSUSE 15.1, Ubuntu 18.04]: Fedora 40
  • stestr version (stestr --version): stestr 4.1.0
  • Python release (python --version): Python 3.10.14
  • pip packages (pip freeze): n/a

Additional information

None.

@stephenfin stephenfin added the bug label Aug 28, 2024
stephenfin added a commit to stephenfin/stestr that referenced this issue Aug 28, 2024
Fixes mtreinish#364.

Signed-off-by: Stephen Finucane <[email protected]>
Repository owner deleted a comment Aug 28, 2024
stephenfin added a commit to stephenfin/stestr that referenced this issue Aug 29, 2024
Fixes mtreinish#364.

Signed-off-by: Stephen Finucane <[email protected]>
stephenfin added a commit to stephenfin/stestr that referenced this issue Aug 29, 2024
Fixes mtreinish#364.

Signed-off-by: Stephen Finucane <[email protected]>
@github-staff github-staff deleted a comment from robykartis Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@stephenfin and others