Skip to content

Commit 4daf82a

Browse files
committed
Update live API healthcheck workflow to use new test target and add streaming marker to player game tests
1 parent d493a09 commit 4daf82a

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

.github/workflows/live-api-healthcheck.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ jobs:
2727
run: make setup
2828

2929
- name: Run tests against live API
30-
run: make test_live_api
30+
# Streaming endpoints can intermittently hang or time out for many
31+
# minutes. To keep the healthcheck fast and reliable we skip tests
32+
# marked with the `streaming` marker in this workflow and run the
33+
# non-streaming test target instead.
34+
run: make test_live_no_streaming
3135
id: test
3236
continue-on-error: true
3337

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ To be released
66

77

88
* Deprecate Python 3.9 support - minimum required version is now Python 3.10+. This does not mean the library will not work with Python 3.9, but it will not be tested against it anymore.
9+
* Added test_live_no_streaming Makefile target and updated live-api-healthcheck GitHub Actions workflow to use it.
910
* Updated typing and client behavior for the ``opening_explorer``:
1011
- Added new typed dicts ``PlayerOpeningStatistic`` and ``MastersOpeningStatistic`` in ``berserk.types.opening_explorer``.
1112
- Updated ``client.opening_explorer`` method signatures to return the new types.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ test_record: ## run tests with pytest and record http requests
3636
uv run pytest --record-mode=once tests
3737

3838
test_live_api: ## run tests with live API (no cassettes)
39-
uv run pytest --disable-recording --throttle-time=1.0 tests
39+
uv run pytest --disable-recording --throttle-time=5.0 tests
40+
41+
test_live_no_streaming: ## run live tests but skip streaming-marked tests
42+
uv run pytest --disable-recording --throttle-time=5.0 -m "not streaming" tests
4043

4144
typecheck: ## run type checking with pyright
4245
uv run pyright berserk integration/local.py $(ARGS)

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,8 @@ build-backend = "uv_build"
6767

6868
[tool.uv.build-backend]
6969
module-root = ""
70+
71+
[tool.pytest.ini_options]
72+
markers = [
73+
"streaming: test that use a streaming endpoint.",
74+
]

tests/clients/test_opening_explorer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def test_export(self):
7676
class TestPlayerGames:
7777
@pytest.mark.vcr
7878
@pytest.mark.default_cassette("TestPlayerGames.results.yaml")
79+
@pytest.mark.streaming
7980
def test_wait_for_last_results(self):
8081
result = Client().opening_explorer.get_player_games(
8182
player="evachesss", color="white", wait_for_indexing=True
@@ -84,6 +85,7 @@ def test_wait_for_last_results(self):
8485

8586
@pytest.mark.vcr
8687
@pytest.mark.default_cassette("TestPlayerGames.results.yaml")
88+
@pytest.mark.streaming
8789
def test_get_first_result_available(self):
8890
result = Client().opening_explorer.get_player_games(
8991
player="evachesss",
@@ -94,6 +96,7 @@ def test_get_first_result_available(self):
9496

9597
@pytest.mark.vcr
9698
@pytest.mark.default_cassette("TestPlayerGames.results.yaml")
99+
@pytest.mark.streaming
97100
def test_stream(self):
98101
iterator = Client().opening_explorer.stream_player_games(
99102
player="evachesss",

0 commit comments

Comments
 (0)