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

rebuild the unit test suite for synse server #298

Merged
merged 40 commits into from
Apr 29, 2019
Merged

Conversation

edaniszewski
Copy link
Contributor

===================================================================== test session starts =====================================================================
platform darwin -- Python 3.6.7, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
cachedir: .tox/py36/.pytest_cache
rootdir: /Users/edaniszewski/dev/vaporio/synse-server
plugins: mock-1.10.4, metadata-1.8.0, html-1.20.0, cov-2.6.1, asyncio-0.10.0
collected 426 items                                                                                                                                           

tests/unit/test_app.py .
tests/unit/test_cache.py .........................................
tests/unit/test_errors.py ...........
tests/unit/test_log.py ..
tests/unit/test_plugin.py ......................................
tests/unit/test_server.py ....
tests/unit/test_tasks.py .
tests/unit/test_utils.py .............
tests/unit/api/test_http.py ......................................................................................................................................................ssssssssssssssss..................................................................
tests/unit/cmd/test_config.py ....
tests/unit/cmd/test_info.py ..
tests/unit/cmd/test_plugin.py ..........
tests/unit/cmd/test_read.py ................
tests/unit/cmd/test_scan.py ......
tests/unit/cmd/test_tags.py .......
tests/unit/cmd/test_test.py .
tests/unit/cmd/test_transaction.py .........
tests/unit/cmd/test_version.py .
tests/unit/cmd/test_write.py ..........
tests/unit/discovery/test_kubernetes.py ...............

--------------------------------- generated html file: /Users/edaniszewski/dev/vaporio/synse-server/results/pytest/index.html ---------------------------------

---------- coverage: platform darwin, python 3.6.7-final-0 -----------
Name                                   Stmts   Miss  Cover
----------------------------------------------------------
synse_server/__init__.py                   8      0   100%
synse_server/__main__.py                   3      3     0%
synse_server/api/__init__.py               0      0   100%
synse_server/api/http.py                 130     17    87%
synse_server/api/websocket.py              9      6    33%
synse_server/app.py                       12      0   100%
synse_server/cache.py                     74      0   100%
synse_server/cmd/__init__.py              10      0   100%
synse_server/cmd/config.py                 6      0   100%
synse_server/cmd/info.py                  13      0   100%
synse_server/cmd/plugin.py                54      0   100%
synse_server/cmd/read.py                  52      0   100%
synse_server/cmd/scan.py                  28      0   100%
synse_server/cmd/tags.py                  16      0   100%
synse_server/cmd/test.py                   6      0   100%
synse_server/cmd/transaction.py           27      0   100%
synse_server/cmd/version.py                6      0   100%
synse_server/cmd/write.py                 34      0   100%
synse_server/config.py                     3      0   100%
synse_server/discovery/__init__.py         0      0   100%
synse_server/discovery/kubernetes.py      71      1    99%
synse_server/errors.py                    30      0   100%
synse_server/i18n.py                       5      0   100%
synse_server/log.py                       11      0   100%
synse_server/plugin.py                    99      0   100%
synse_server/server.py                    46      0   100%
synse_server/tasks.py                     16      8    50%
synse_server/utils.py                     16      0   100%
----------------------------------------------------------
TOTAL                                    785     35    96%
Coverage HTML written to dir results/coverage

=========================================================== 410 passed, 16 skipped in 2.35 seconds ============================================================
___________________________________________________________________________ summary ___________________________________________________________________________
  py36: commands succeeded
  congratulations :)

This PR rebuilds the entire unit test suite for Synse Server, fixing up a lot of the odd/inconsistent/bad test patterns from before, simplifying things a bit, and vastly expanding the number of tests and coverage. There are two caveats to this test suite right now:

  1. The kubnernetes discovery tests were just copied over from v2. Then need some work to get them cleaned up and following better test practices. Will open a separate issue. This will be done post-v3 release as it is non-blocking for other work (unless someone else wants to do it earlier)
  2. The tests for the /readcache endpoint are written, but they are all skipped. I have not been able to get the tests working with the existing testing tools. The issue seems to be around sanic's testing support around response streaming. I opened a discussion topic on their help board and will wait for a resolution there before determining what the next steps are.

fixes #220

@edaniszewski edaniszewski added this to the Sprint 04/16-04/30 milestone Apr 26, 2019
@edaniszewski