-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added tests for api requests #78
Conversation
- Assigned version 1.0.0 to requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent to have unit test cov for these endpoints, @Alopalao.
1 - If you can also refactor e2e test_e2e_40_sdntrace.py, the e2e test cases were using the unversioned endpoints:
tests/test_e2e_40_sdntrace.py
149: api_url = KYTOS_API + '/amlight/sdntrace/trace'
189: api_url = KYTOS_API + '/amlight/sdntrace/trace'
236: api_url = KYTOS_API + '/amlight/sdntrace/trace'
335: api_url = KYTOS_API + '/amlight/sdntrace/trace'
382: api_url = KYTOS_API + '/amlight/sdntrace/trace'
822: api_url = KYTOS_API + '/amlight/sdntrace/trace'
866: api_url = KYTOS_API + '/amlight/sdntrace/trace'
2 - The exec on scrutinizer there was an unexpected traceback, check it out if it's deterministic or not:
https://scrutinizer-ci.com/g/kytos-ng/sdntrace/inspections/a8ba7476-7b75-4849-8035-ca7101cb799e/log
tests/unit/tracing/test_trace_manager.py::TestTraceManager::test_is_entry_invalid_not_colored
/home/scrutinizer/build/.tox/py311/lib/python3.11/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning: Exception ignored in thread started by: <bound method TraceManager._spawn_trace of <napps.amlight.sdntrace.tracing.trace_manager.TraceManager object at 0x7f9bee815990>>
Traceback (most recent call last):
File "/home/scrutinizer/build/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/trace_manager.py", line 94, in _spawn_trace
tracer = TracePath(self, trace_id, trace_entries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scrutinizer/build/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/tracer.py", line 47, in __init__
self.init_switch = self.get_init_switch()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/scrutinizer/build/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/tracer.py", line 56, in get_init_switch
return Switches().get_switch(self.init_entries.dpid)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'dpid'
warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
Also, UI client request endpoints need to be updated too (here's one line for example): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This exception in the tests:
It is caused because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done @Alopalao.
Regarding the unit test thread issue, that's a sign that that part isn't easy and graceful to test, so in the future it deserves a refactoring, but it's a not blocker, so map in issue for it, but continue on the other ones that it's on your radar, OK? Thanks
Feel free to merge this and the e2e test PR.
Leaving this comment as reference that here was fulfilled kytos issue #487 |
Closes #38
Closes #46
Summary
Added tests for API request from
main.py
Assigned version 1.0.0 to requests
Local Tests
Made requests to test versioning
End-to-End Tests
Results from e2e PR