-
Notifications
You must be signed in to change notification settings - Fork 55
LCORE-304: devel documentation #262
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| # GitHub pages | ||
| # Lightspeed-Stack Documentation | ||
|
|
||
| Welcome. This directory is published via GitHub Pages. | ||
| See the full documentation at [`../README.md`](../README.md) or browse sub-pages in `docs/`. |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,23 @@ | ||||||||||
| # Testing | ||||||||||
|
|
||||||||||
| <!-- vim-markdown-toc GFM --> | ||||||||||
|
|
||||||||||
| * [Running tests](#running-tests) | ||||||||||
| * [Run all tests](#run-all-tests) | ||||||||||
| * [Select one group of tests](#select-one-group-of-tests) | ||||||||||
| * [Select individual test or group of tests to be run](#select-individual-test-or-group-of-tests-to-be-run) | ||||||||||
| * [Unit tests](#unit-tests) | ||||||||||
| * [Unit tests structure](#unit-tests-structure) | ||||||||||
| * [Integration tests](#integration-tests) | ||||||||||
| * [End to end tests](#end-to-end-tests) | ||||||||||
| * [Tips and hints](#tips-and-hints) | ||||||||||
| * [Developing unit tests](#developing-unit-tests) | ||||||||||
| * [Patching](#patching) | ||||||||||
| * [Verifying that some exception is thrown](#verifying-that-some-exception-is-thrown) | ||||||||||
| * [Checking what was printed and logged to stdout or stderr by the tested code](#checking-what-was-printed-and-logged-to-stdout-or-stderr-by-the-tested-code) | ||||||||||
|
|
||||||||||
| <!-- vim-markdown-toc --> | ||||||||||
|
|
||||||||||
| Three groups of software tests are used in this repository, each group from the test suite having different granularity. These groups are designed to represent three layers: | ||||||||||
|
|
||||||||||
| 1. Unit Tests | ||||||||||
|
|
@@ -10,22 +28,39 @@ Three groups of software tests are used in this repository, each group from the | |||||||||
|
|
||||||||||
| ## Running tests | ||||||||||
|
|
||||||||||
| ### Run all tests | ||||||||||
|
|
||||||||||
| Unit tests followed by integration and end to end tests can be started by using the following command: | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| ```bash | ||||||||||
| make test | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Select one group of tests | ||||||||||
|
|
||||||||||
| It is also possible to run just one selected group of tests: | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| ```bash | ||||||||||
| make test-unit Run the unit tests | ||||||||||
| make test-integration Run integration tests tests | ||||||||||
| make test-e2e Run end to end tests | ||||||||||
|
Comment on lines
+43
to
46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate word “tests” in integration command description
-make test-integration Run integration tests tests
+make test-integration Run integration tests📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| ``` | ||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| ### Select individual test or group of tests to be run | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| uv run python -m pytest -vv tests/unit/utils/ | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Or, if you prefer to see coverage information, use following command: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| uv run python -m pytest -vv tests/unit/utils/ --cov=src/utils/ --cov-report term-missing | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
|
|
||||||||||
| ## Unit tests | ||||||||||
|
|
||||||||||
| Unit tests are based on the [Pytest framework](https://docs.pytest.org/en/) and code coverage is measured by the plugin [pytest-cov](https://github.com/pytest-dev/pytest-cov). For mocking and patching, the [unittest framework](https://docs.python.org/3/library/unittest.html) is used. | ||||||||||
|
|
@@ -34,6 +69,8 @@ Currently code coverage threshold for integration tests is set to 60%. This valu | |||||||||
|
|
||||||||||
| As specified in Definition of Done, new changes need to be covered by tests. | ||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| ### Unit tests structure | ||||||||||
|
|
||||||||||
| * Defined in [tests/unit](https://github.com/lightspeed-core/lightspeed-stack/tree/main/tests/unit) | ||||||||||
|
|
||||||||||
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.
🛠️ Refactor suggestion
Fix MD007 list-indent violations in the TOC
The second-level bullets are indented with four spaces instead of two, triggering markdownlint warnings and producing slightly off alignment in some renderers.
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
6-6: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
7-7: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
8-8: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
🤖 Prompt for AI Agents