Skip to content

Commit a7f67f2

Browse files
authored
Merge pull request #234 from grillazz/switch-logger-to-rotoger
docs: add testing strategy section to README for improved clarity on …
2 parents ab7dd25 + 57901fe commit a7f67f2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<li><a href="#import-xlsx-files-with-polars-and-calamine">Import xlsx files with polars and calamine</a></li>
3131
<li><a href="#worker-aware-async-scheduler">Schedule jobs</a></li>
3232
<li><a href="#smtp-setup">Email Configuration</a></li>
33+
<li><a href="#testing-strategy">Testing Strategy</a></li>
3334
<li><a href="#uv-knowledge-and-inspirations">UV knowledge and inspirations</a></li>
3435
<li><a href="#large-language-model">Integration with local LLM</a></li>
3536
<li><a href="#ha-sample-with-nginx-as-load-balancer">High Availability sample with nginx as load balancer</a></li>
@@ -153,6 +154,18 @@ throughout the application lifecycle, optimizing resource usage.
153154

154155
<p align="right">(<a href="#readme-top">back to top</a>)</p>
155156

157+
### Testing Strategy
158+
The project employs a robust testing strategy to ensure code quality and reliability. The test fixture infrastructure has been designed to provide strong test isolation, particularly concerning database interactions.
159+
160+
A key component of this strategy is a `db_session` fixture that manages database transactions on a per-test basis. Each test runs within its own transaction, which is rolled back at the end of the test. This ensures that tests are independent and do not interfere with each other by leaving residual data in the database.
161+
162+
This approach offers several benefits:
163+
- **Improved Test Isolation**: By rolling back transactions, each test starts with a clean database state.
164+
- **Explicit Session Management**: Test fixtures use explicit dependency overrides with the new session management, making the testing setup clear and maintainable.
165+
- **Direct Database Manipulation**: Where appropriate, tests use direct database manipulation for setting up test data, which can be more efficient and straightforward than using API endpoints.
166+
167+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
168+
156169
### Large Language Model
157170
The `/v1/ml/chat/` endpoint is designed to handle chat-based interactions with the LLM model.
158171
It accepts a user prompt and streams responses back in real-time.
@@ -210,6 +223,12 @@ I've included a few of my favorites to kick things off!
210223

211224

212225
## Change Log
226+
<details>
227+
<summary>2026 (1 change)</summary>
228+
<ul>
229+
<li>[JAN 11 2026] refactor test fixture infrastructure to improve test isolation :test_tube:</li>
230+
</ul>
231+
</details>
213232
<details>
214233
<summary>2025 (7 changes)</summary>
215234
<ul>

0 commit comments

Comments
 (0)