Test that engine-runner does not depend on language-server

This commit is contained in:
Pavel Marek 2024-09-23 15:45:50 +02:00
parent 31290d1ba1
commit 83ef8ae617
3 changed files with 3 additions and 4 deletions

View File

@ -3621,7 +3621,6 @@ lazy val `engine-runner` = project
.dependsOn(`engine-runner-common`) .dependsOn(`engine-runner-common`)
.dependsOn(`polyglot-api`) .dependsOn(`polyglot-api`)
.dependsOn(`enso-test-java-helpers`) .dependsOn(`enso-test-java-helpers`)
.dependsOn(`language-server` % Runtime)
lazy val buildSmallJdk = lazy val buildSmallJdk =
taskKey[File]("Build a minimal JDK used for native image generation") taskKey[File]("Build a minimal JDK used for native image generation")

View File

@ -20,6 +20,9 @@ public abstract class LanguageServerApi {
var it = var it =
ServiceLoader.load(LanguageServerApi.class, LanguageServerApi.class.getClassLoader()) ServiceLoader.load(LanguageServerApi.class, LanguageServerApi.class.getClassLoader())
.iterator(); .iterator();
if (!it.hasNext()) {
throw new WrongOption("No language server implementation found");
}
var impl = it.next(); var impl = it.next();
impl.runLanguageServer(line, config, logLevel); impl.runLanguageServer(line, config, logLevel);
} }

View File

@ -16,9 +16,6 @@ public class EngineRunnerDependenciesTest {
public EngineRunnerDependenciesTest() {} public EngineRunnerDependenciesTest() {}
@Test @Test
// ignored for now as engine-runner still has "Runtime" dependency on language-server and that one
// appears in test classpath - remove once language-server is packaged as its own JAR file
@Ignore
public void unableToLoadClassFromLanguageServerProject() { public void unableToLoadClassFromLanguageServerProject() {
try { try {
var b = new CommandLine.Builder(); var b = new CommandLine.Builder();