Skip to content

Commit 701a6e8

Browse files
committed
ci: run unit tests in CI
Unit tests (tests/unit/) were never run in CI — only integration tests that require a running Scylla cluster. Since unit tests use mocks and have no external dependencies, they are fast and cheap to run, and would have caught regressions like the missing scope validation in wait_for_schema_agreement (#917) and the error accumulation bug in _set_keyspace_for_all_pools (#915). Mark the two pre-existing test failures as xfail (referencing their fix PRs) so they don't block this change while the fixes are pending.
1 parent c1bfd54 commit 701a6e8

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ jobs:
7777
- name: Build driver
7878
run: uv sync
7979

80+
- name: Unit tests
81+
run: uv run pytest tests/unit/test_*.py -x
82+
8083
- name: Cache Scylla download
8184
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8285
with:

tests/unit/test_cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,15 @@ def test_wait_for_schema_agreement_cluster_scope_excludes_hosts_with_unknown_sta
591591
assert self._host_query_count(session, hosts[0]) == 0
592592
assert self._host_query_count(session, hosts[1]) == 1
593593

594+
@pytest.mark.xfail(reason="scope validation not implemented (#917)", strict=False)
594595
@mock_session_pools
595596
def test_wait_for_schema_agreement_rejects_unknown_scope(self, *_):
596597
session, _, _ = self._new_schema_agreement_session(["a"])
597598

598599
with pytest.raises(ValueError):
599600
session.wait_for_schema_agreement(wait_time=1, scope='planet')
600601

602+
@pytest.mark.xfail(reason="_set_keyspace_for_all_pools passes only last pool errors (#915)", strict=False)
601603
@mock_session_pools
602604
def test_set_keyspace_for_all_pools_reports_all_errors(self, *_):
603605
cluster = Cluster()

0 commit comments

Comments
 (0)