Skip SerenaAgent tests using Java in CI #788

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-12-05 02:27:17 +01:00
1 parent fdeee664ee
commit b046f2cb24
3 files changed
+13 -6

No files matched your search

+8
View File
@@ -1,4 +1,6 @@
import logging
import os
import platform
from pathlib import Path
import pytest
@@ -144,3 +146,9 @@ def project(request: LanguageParamRequest):
language = request.param
yield create_default_project(language)
is_ci = os.getenv("CI") == "true" or os.getenv("GITHUB_ACTIONS") == "true"
# We skip Java tests in CI if not on Windows (hangs on Ubuntu for unknown reasons; testing on Windows is sufficient)
java_tests_enabled = not is_ci or platform.system() == "Windows"
+4 -1
View File
@@ -11,7 +11,7 @@ from serena.config.serena_config import ProjectConfig, RegisteredProject, Serena
from serena.project import Project
from serena.tools import FindReferencingSymbolsTool, FindSymbolTool
from solidlsp.ls_config import Language
from test.conftest import get_repo_path
from test.conftest import get_repo_path, java_tests_enabled
@pytest.fixture
@@ -56,6 +56,9 @@ def serena_config():
@pytest.fixture
def serena_agent(request: pytest.FixtureRequest, serena_config):
language = Language(request.param)
if language == Language.JAVA and not java_tests_enabled:
pytest.skip("Java tests are not enabled")
project_name = f"test_repo_{language}"
return SerenaAgent(project=project_name, serena_config=serena_config)
+1 -5
View File
@@ -1,16 +1,12 @@
import os
import platform
import pytest
from solidlsp import SolidLanguageServer
from solidlsp.ls_config import Language
from solidlsp.ls_utils import SymbolUtils
from test.conftest import java_tests_enabled
# 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")]