Skip to content

ci: split tests into offline and live#1677

Draft
pcriadoperez wants to merge 1 commit intosammchardy:masterfrom
pcriadoperez:split-offline-live-tests
Draft

ci: split tests into offline and live#1677
pcriadoperez wants to merge 1 commit intosammchardy:masterfrom
pcriadoperez:split-offline-live-tests

Conversation

@pcriadoperez
Copy link
Collaborator

Summary

  • Introduce @pytest.mark.live marker to separate mocked/offline tests from live/testnet tests
  • Offline tests (pytest -m "not live") run strict with no reruns — if a new test forgets the marker and needs network, it fails immediately (safe default)
  • Live tests (pytest -m "live") run with --reruns 3 to tolerate testnet flakiness
  • Split GitHub Actions into parallel test-offline (10min timeout, no credentials) and test-live (40min timeout, with credentials) jobs
  • Add tox -e offline and tox -e live environments
  • Refactor module-level API call in test_threaded_socket_manager.py into a fixture so it doesn't run during offline test collection

Test plan

  • pytest -m "not live" --strict-markers collects 104 offline tests, all pass without network
  • pytest -m "live" collects 995 live tests
  • Total 1099 = 104 + 995 (no tests lost)
  • Verify both GH Actions jobs run independently after merge

🤖 Generated with Claude Code

Separate mocked/offline tests from live/testnet tests using a
`@pytest.mark.live` marker so offline tests run strict (no reruns)
and live tests tolerate flakiness (--reruns 3).

- Register `live` marker in conftest.py and pyproject.toml
- Add `pytest.mark.live` to 23 live test files
- Handle mixed file (test_client_gift_card.py) with per-function markers
- Refactor module-level API call in test_threaded_socket_manager.py into fixture
- Add tox environments: `offline` and `live`
- Split GitHub Actions into parallel test-offline and test-live jobs
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.

1 participant