Skip to content

Move live/network tests out of CI into pre-push git hook - #129

Merged
sevakram merged 7 commits into
masterfrom
fix/cache-concurrency-race
Aug 6, 2026
Merged

Move live/network tests out of CI into pre-push git hook#129
sevakram merged 7 commits into
masterfrom
fix/cache-concurrency-race

Conversation

@sevakram

@sevakram sevakram commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

test_bse_live.py and other tests making real network API calls (BSE/NSE) are slow and fail in CI (blocked/rate-limited API responses).

Solution

  • Tagged network-dependent tests with @pytest.mark.live
  • CI runs pytest -m "not live" to skip live tests
  • New .githooks/pre-push hook runs all tests (including live) on every push — this is the gating check that catches upstream API changes
  • Fixed test_bhavcopy_recent to use a fixed past date (was using date.today() which fails when market hasn't started)
  • Default pytest still runs everything; CI and hook explicitly opt in/out of live tests

Usage

To enable the hook for your checkout:

git config core.hooksPath .githooks

Skip checks on push: git push --no-verify

@sevakram
sevakram merged commit c6d8361 into master Aug 6, 2026
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