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

[unittest] Unable to run unittest locally #1160

Closed
Blueve opened this issue Oct 10, 2020 · 3 comments · Fixed by #1161
Closed

[unittest] Unable to run unittest locally #1160

Blueve opened this issue Oct 10, 2020 · 3 comments · Fixed by #1161

Comments

@Blueve
Copy link
Contributor

Blueve commented Oct 10, 2020

Description

The README.md told that we can run unit tests locally by executing python2 setup.py test, but it will failed due to some packages are missing.

Is there a guideline to run the tests from scratch? Now, I have to enter sonic-buildimage repository and build the python-wheel to get a test result. Since the sonic-utilties is an independent repository and it has its own readme document, it is quite confusing me.

Expected Action For This Issue

Update README.md

Steps to reproduce the issue

  1. Clone sonic-buildimage
  2. Enter src\sonic-utilities
  3. Run python2 setup.py test
  4. Check the output

Describe the results you received

jika@jika-vm-01:~/soniccli/consolecli/src/sonic-utilities$ python2 setup.py test
running pytest
Searching for swsssdk>=2.0.1
Reading https://pypi.python.org/simple/swsssdk/
Couldn't find index page for 'swsssdk' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or working download links found for swsssdk>=2.0.1
error: Could not find suitable distribution for Requirement.parse('swsssdk>=2.0.1')

Describe the results you expected
Unit test result table and logs.

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)
@lguohan
Copy link
Contributor

lguohan commented Oct 10, 2020

@jleveque , can you provide instructions in the README.md for how to run the unit test? It seems i heard multiple people have difficulty to run the sonic utilities unit test.

lguohan pushed a commit that referenced this issue Oct 11, 2020
…1161)

Add instructions for setting up an environment to build the sonic-utilities package and run unit tests

Resolves #1160
@lguohan
Copy link
Contributor

lguohan commented Oct 11, 2020

@Blueve, please try the instructions and let us know if you have any further issue.

@Blueve
Copy link
Contributor Author

Blueve commented Oct 12, 2020

Works perfectly! Thanks @jleveque @lguohan ! It's really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants