Merge pull request #778 from oraios/enable-java-tests

Enable Java tests in CI (at least on Windows)
This commit is contained in:
Dominik Jain authored and GitHub committed 2025-11-20 12:17:39 +01:00
commit 4a5284136d
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -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"
+7 -1
View File
@@ -1,4 +1,5 @@
import os
import platform
import pytest
@@ -6,8 +7,13 @@ 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)
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")]
@pytest.mark.java
class TestJavaLanguageServer:
@pytest.mark.parametrize("language_server", [Language.JAVA], indirect=True)
def test_find_symbol(self, language_server: SolidLanguageServer) -> None: