From dede2efcb1cd55ca200176167887e9781903bb03 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 19 Nov 2025 22:06:09 +0100 Subject: [PATCH 1/3] Enable Java tests --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 14c27deb..1f2c122e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,7 @@ PYDEVD_DISABLE_FILE_VALIDATION = "1" # Uses PYTEST_MARKERS env var for default markers # For custom markers, one can either adjust the env var or just use -m option in the command line, # as the second -m option will override the first one. -test = "pytest test -vv -m \"${PYTEST_MARKERS:-not java and not rust and not erlang}\"" +test = "pytest test -vv -m \"${PYTEST_MARKERS:-not rust and not erlang}\"" _black_check = "black --check src scripts test" _ruff_check = "ruff check src scripts test" _black_format = "black src scripts test" From 2b157d4e8f9959f36982d94c08d4fe1773c27fd8 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Thu, 20 Nov 2025 00:38:05 +0100 Subject: [PATCH 2/3] Limit Java tests to Windows --- test/solidlsp/java/test_java_basic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/solidlsp/java/test_java_basic.py b/test/solidlsp/java/test_java_basic.py index 0b081695..1b1ed458 100644 --- a/test/solidlsp/java/test_java_basic.py +++ b/test/solidlsp/java/test_java_basic.py @@ -1,4 +1,5 @@ import os +import platform import pytest @@ -6,8 +7,11 @@ from solidlsp import SolidLanguageServer from solidlsp.ls_config import Language from solidlsp.ls_utils import SymbolUtils +# These marks will be applied to all tests in this module +# We skip the tests if not on Windows (CI hangs on Ubuntu for unknown reasons; testing on Windows is sufficient) +pytestmark = [pytest.mark.java, pytest.mark.skipif(platform.system() != "Windows", reason="Java tests are only run on Windows")] + -@pytest.mark.java class TestJavaLanguageServer: @pytest.mark.parametrize("language_server", [Language.JAVA], indirect=True) def test_find_symbol(self, language_server: SolidLanguageServer) -> None: From 9709be8e7a449d783bf24aa411b8ab4239f0c6a2 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Thu, 20 Nov 2025 06:28:14 +0100 Subject: [PATCH 3/3] Skip Java tests only in CI --- test/solidlsp/java/test_java_basic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/solidlsp/java/test_java_basic.py b/test/solidlsp/java/test_java_basic.py index 1b1ed458..5b3bcd6a 100644 --- a/test/solidlsp/java/test_java_basic.py +++ b/test/solidlsp/java/test_java_basic.py @@ -7,9 +7,11 @@ from solidlsp import SolidLanguageServer from solidlsp.ls_config import Language from solidlsp.ls_utils import SymbolUtils -# These marks will be applied to all tests in this module +# These marks will be applied to all tests in this module. # We skip the tests if not on Windows (CI hangs on Ubuntu for unknown reasons; testing on Windows is sufficient) -pytestmark = [pytest.mark.java, pytest.mark.skipif(platform.system() != "Windows", reason="Java tests are only run on Windows")] +is_ci = os.getenv("CI") == "true" or os.getenv("GITHUB_ACTIONS") == "true" +java_tests_enabled = not is_ci or platform.system() == "Windows" +pytestmark = [pytest.mark.java, pytest.mark.skipif(not java_tests_enabled, reason="Java tests are only run on Windows in CI")] class TestJavaLanguageServer: