From 701a6e8baa1f07696568019e87030c0161b35cea Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Mon, 29 Jun 2026 23:46:34 +0300 Subject: [PATCH] ci: run unit tests in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/integration-tests.yml | 3 +++ tests/unit/test_cluster.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5e76d6bbb4..680d1796ad 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -77,6 +77,9 @@ jobs: - name: Build driver run: uv sync + - name: Unit tests + run: uv run pytest tests/unit/test_*.py -x + - name: Cache Scylla download uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: diff --git a/tests/unit/test_cluster.py b/tests/unit/test_cluster.py index 3d55bc1860..87fb29e235 100644 --- a/tests/unit/test_cluster.py +++ b/tests/unit/test_cluster.py @@ -591,6 +591,7 @@ def test_wait_for_schema_agreement_cluster_scope_excludes_hosts_with_unknown_sta assert self._host_query_count(session, hosts[0]) == 0 assert self._host_query_count(session, hosts[1]) == 1 + @pytest.mark.xfail(reason="scope validation not implemented (#917)", strict=False) @mock_session_pools def test_wait_for_schema_agreement_rejects_unknown_scope(self, *_): session, _, _ = self._new_schema_agreement_session(["a"]) @@ -598,6 +599,7 @@ def test_wait_for_schema_agreement_rejects_unknown_scope(self, *_): with pytest.raises(ValueError): session.wait_for_schema_agreement(wait_time=1, scope='planet') + @pytest.mark.xfail(reason="_set_keyspace_for_all_pools passes only last pool errors (#915)", strict=False) @mock_session_pools def test_set_keyspace_for_all_pools_reports_all_errors(self, *_): cluster = Cluster()