You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "airajena (via GitHub)" <gi...@apache.org> on 2026/08/03 08:20:02 UTC

[PR] test: add unit tests for extractor module with pytest [fineract-business-intelligence]

airajena opened a new pull request, #49:
URL: https://github.com/apache/fineract-business-intelligence/pull/49

   ## Summary
   Add unit tests for the extractor module — COB gate, watermark logic, source query building, upsert SQL, replica lag check, and config loading.
   
   ## Test plan
   - 71 unit tests, no database required, runs in ~0.25s
   - Run locally: `pip install -r requirements-dev.txt && pytest tests/unit/extractor -v`
   - Added to CI (`compilation-checks` job) — runs on every push
   
   <!-- screenshot: all 71 tests passing -->
   
   ## Files changed
   
   **`.github/workflows/ci.yml`** (+4 lines)
   - Installs `requirements-dev.txt` in `compilation-checks` job
   - Adds step: `pytest tests/unit/extractor -v`, before the dbt parse step
   
   **`pytest.ini`** (new)
   - Test discovery config: path, file/function naming, `--strict-markers` + `-ra` flags
   
   **`requirements-dev.txt`** (new)
   - Test-only deps (`pytest`, `pytest-mock`, `freezegun`) — separate from `extractor/requirements.txt` so test tooling never ships into the production image
   
   **`tests/`** (new, 8 files, 71 tests)
   - `conftest.py` — shared fixtures: `FakeCursor`/`FakeConnection` (in-memory pg8000 stand-ins), `app_config`
   - `unit/extractor/test_*.py` — COB gate, config loading, quote/timestamp helpers, replica lag, source query building, upsert SQL, watermark logic
   
   ## Scope
   Extractor module only. dbt, Superset, and RLS test modules will follow in separate PRs.
   Parent Issue : [45](https://github.com/apache/fineract-business-intelligence/issues/45)
   
   ## Screenshots
   <img width="1482" height="714" alt="image" src="https://github.com/user-attachments/assets/364d2a32-171d-4046-b65f-d8d59d876711" />
   <img width="1562" height="698" alt="image" src="https://github.com/user-attachments/assets/d238e1c7-ef43-4ce6-8f4a-31179b160f78" />
   <img width="1612" height="689" alt="image" src="https://github.com/user-attachments/assets/52833ea2-8687-4456-8038-b667e5991095" />
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test: add unit tests for extractor module with pytest [fineract-business-intelligence]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on PR #49:
URL: https://github.com/apache/fineract-business-intelligence/pull/49#issuecomment-5168652880

   @airajena Link a issue with this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test: add unit tests for extractor module with pytest [fineract-business-intelligence]

Posted by "airajena (via GitHub)" <gi...@apache.org>.
airajena commented on PR #49:
URL: https://github.com/apache/fineract-business-intelligence/pull/49#issuecomment-5168683572

   > @airajena Link a issue with this
   
   yes done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test: add unit tests for extractor module with pytest [fineract-business-intelligence]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal merged PR #49:
URL: https://github.com/apache/fineract-business-intelligence/pull/49


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org