From 0cb8e490811ea64b9d0f148d38bfede54cf3d517 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Thu, 31 Oct 2024 14:53:09 +0800 Subject: [PATCH] Wait more time --- test/gradle-suite/projectView.test.ts | 6 +++++- test/invisible-suite/projectView.test.ts | 14 +++++--------- test/maven-suite/projectView.test.ts | 7 +++++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/test/gradle-suite/projectView.test.ts b/test/gradle-suite/projectView.test.ts index ec5a045d..4a4e6776 100644 --- a/test/gradle-suite/projectView.test.ts +++ b/test/gradle-suite/projectView.test.ts @@ -3,13 +3,17 @@ import * as assert from "assert"; import { ContainerNode, contextManager, DataNode, DependencyExplorer, + languageServerApiManager, PackageRootNode, PrimaryTypeNode, ProjectNode } from "../../extension.bundle"; import { fsPath, setupTestEnv, Uris } from "../shared"; // tslint:disable: only-arrow-functions suite("Gradle Project View Tests", () => { - suiteSetup(setupTestEnv); + suiteSetup(async () => { + await setupTestEnv(); + await languageServerApiManager.ready(); + }); test("Can node render correctly", async function() { const explorer = DependencyExplorer.getInstance(contextManager.context); diff --git a/test/invisible-suite/projectView.test.ts b/test/invisible-suite/projectView.test.ts index c1488ce7..61e91d01 100644 --- a/test/invisible-suite/projectView.test.ts +++ b/test/invisible-suite/projectView.test.ts @@ -3,22 +3,21 @@ import * as assert from "assert"; import * as fse from "fs-extra"; -import { platform } from "os"; import * as path from "path"; import * as vscode from "vscode"; -import { Commands, contextManager, DependencyExplorer, PackageNode, PackageRootNode, ProjectNode } from "../../extension.bundle"; +import { Commands, contextManager, DependencyExplorer, languageServerApiManager, PackageNode, PackageRootNode, ProjectNode } from "../../extension.bundle"; import { setupTestEnv } from "../shared"; import { sleep } from "../util"; // tslint:disable: only-arrow-functions suite("Invisible Project View Tests", () => { - suiteSetup(setupTestEnv); + suiteSetup(async () => { + await setupTestEnv(); + await languageServerApiManager.ready(); + }); test("Can execute command java.project.refreshLibraries correctly", async function() { - if (platform() === "darwin") { - this.skip(); - } const explorer = DependencyExplorer.getInstance(contextManager.context); let projectNode = (await explorer.dataProvider.getChildren())![0] as ProjectNode; @@ -37,9 +36,6 @@ suite("Invisible Project View Tests", () => { }); test("Can execute command java.project.removeLibrary correctly", async function() { - if (platform() === "darwin") { - this.skip(); - } const explorer = DependencyExplorer.getInstance(contextManager.context); let projectNode = (await explorer.dataProvider.getChildren())![0] as ProjectNode; diff --git a/test/maven-suite/projectView.test.ts b/test/maven-suite/projectView.test.ts index b338f209..ec305edd 100644 --- a/test/maven-suite/projectView.test.ts +++ b/test/maven-suite/projectView.test.ts @@ -4,13 +4,16 @@ import * as assert from "assert"; import * as vscode from "vscode"; import { Commands, ContainerNode, contextManager, DataNode, DependencyExplorer, FileNode, - INodeData, Jdtls, NodeKind, PackageNode, PackageRootNode, PrimaryTypeNode, ProjectNode } from "../../extension.bundle"; + INodeData, Jdtls, languageServerApiManager, NodeKind, PackageNode, PackageRootNode, PrimaryTypeNode, ProjectNode } from "../../extension.bundle"; import { fsPath, printNodes, setupTestEnv, Uris } from "../shared"; // tslint:disable: only-arrow-functions suite("Maven Project View Tests", () => { - suiteSetup(setupTestEnv); + suiteSetup(async () => { + await setupTestEnv(); + await languageServerApiManager.ready(); + }); test("Can node render correctly in hierarchical view", async function() { await vscode.workspace.getConfiguration("java.dependency").update("packagePresentation", "hierarchical");