Skip to content

test: add initial unit tests and code coverage support #283

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

Merged
merged 6 commits into from
May 25, 2021

Conversation

ligurio
Copy link
Member

@ligurio ligurio commented Mar 26, 2021

No description provided.

@ligurio ligurio changed the title Add initial unit tests test: add initial unit tests Mar 26, 2021
@ligurio ligurio force-pushed the ligurio/add-unittest branch 6 times, most recently from 6597c67 to 7e1ed3d Compare April 1, 2021 06:54
@ligurio
Copy link
Member Author

ligurio commented Apr 1, 2021

rebased to master

@ligurio ligurio force-pushed the ligurio/add-unittest branch 3 times, most recently from 651f9b2 to 9087358 Compare April 26, 2021 10:05
@ligurio ligurio force-pushed the ligurio/add-unittest branch 4 times, most recently from d9e3881 to 75892f0 Compare May 5, 2021 23:16
@ligurio ligurio force-pushed the ligurio/add-unittest branch from 75892f0 to 63c0c5f Compare May 14, 2021 13:43
@ligurio ligurio force-pushed the ligurio/add-unittest branch 2 times, most recently from 308ea40 to 34ca4be Compare May 20, 2021 07:55
@ligurio ligurio changed the title test: add initial unit tests test: add initial unit tests and code coverage support May 20, 2021
@ligurio ligurio force-pushed the ligurio/add-unittest branch 4 times, most recently from 8d084f0 to 815e0f4 Compare May 20, 2021 11:19
@ligurio ligurio force-pushed the ligurio/add-unittest branch 9 times, most recently from 3ba7910 to 28cd898 Compare May 25, 2021 15:24
Patch introduces integration with coverage.py module [1] that allows to
gather code coverage and build a simple report about covered statements
and branches. We have a test-run.py module itself and also we have Python
helpers for Tarantool tests written in Python. These Python tests runs a
separate processes using subprocess module. To make it possible to gather code
coverage for a separate processes option 'concurrency' added to .coveragerc.

Additionally patch introduces integration with Coveralls
service using python-coveralls module [2] that allows to evaluate
incremental code coverage changes like we do it for Tarantool [3]. Code
coverage for test-run is available on a public page by URL [4].

Name                          Stmts   Miss Branch BrPart    Cover
-----------------------------------------------------------------
dispatcher.py                   281     50     94     12    78.1%
lib/__init__.py                  45      0      6      1    98.0%
lib/admin_connection.py          71      9     22      7    82.8%
lib/app_server.py               162     45     38     11    67.0%
lib/box_connection.py            54     22     12      1    50.0%
lib/colorer.py                  111     28     42      6    68.6%
lib/connpool.py                  85     54     18      1    35.0%
lib/inspector.py                 81     13     26      4    80.4%
lib/options.py                   81     15     18      6    78.8%
lib/preprocessor.py             329    162    162     40    44.6%
lib/pytap13.py                  128     48     58     18    55.9%
lib/server.py                   111     23     40     12    74.2%
lib/server_mixins.py            126     83     28      0    27.9%
lib/tarantool_connection.py     126     28     22      5    75.0%
lib/tarantool_server.py         729    237    268     65    61.5%
lib/test.py                     249    111     86     17    48.1%
lib/test_suite.py               191     35     68     19    77.6%
lib/unittest_server.py           63      6     10      4    86.3%
lib/utils.py                    216     76     86     19    59.9%
lib/worker.py                   251     81     70     15    60.7%
listeners.py                    205     78     70      6    60.0%
test-run.py                     149     76     44      9    42.5%
-----------------------------------------------------------------
TOTAL                          3844   1280   1288    278    61.2%

1. https://coverage.readthedocs.io/en/latest/config.html
2. https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support
3. https://coveralls.io/github/tarantool/tarantool
4. https://coveralls.io/github/tarantool/test-run
@ligurio ligurio force-pushed the ligurio/add-unittest branch from 28cd898 to 394472d Compare May 25, 2021 15:29
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have no objections anymore.

I'll look again just in case and push.

@Totktonada Totktonada merged commit 8592771 into master May 25, 2021
@Totktonada Totktonada deleted the ligurio/add-unittest branch May 25, 2021 22:24
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
@Totktonada
Copy link
Member

Does not matter much here, but anyway:

Updated the test-run submodule in tarantool in the following commits: 2.9.0-45-g0f44ede23, 2.8.1-23-g1b632d36c, 2.7.2-18-g9221e0e28, 1.10.10-10-gbc8463d67.

avtikhon pushed a commit to avtikhon/tarantool that referenced this pull request Jun 1, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
avtikhon pushed a commit to avtikhon/tarantool that referenced this pull request Jun 1, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants