Skip to content

Commit b879ac1

Browse files
committed
Remove full server testing, too problematic for now
1 parent e381804 commit b879ac1

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

apps/expert/test/expert_test.exs

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,9 @@
11
defmodule Expert.ExpertTest do
2-
alias Forge.Test.Fixtures
3-
42
use ExUnit.Case, async: false
5-
use Forge.Test.EventualAssertions
63
use Patch
74

8-
require GenLSP.Test
9-
105
import Expert.Test.Protocol.TransportSupport
116

12-
describe "server testing" do
13-
defp buffer_opts do
14-
[communication: {GenLSP.Communication.TCP, [port: 0]}]
15-
end
16-
17-
defp start_application_children do
18-
pids =
19-
for child_spec <- Expert.Application.children(buffer: buffer_opts()) do
20-
start_supervised!(child_spec)
21-
end
22-
23-
on_exit(fn ->
24-
# NOTE: The test hangs for some reason without manually exiting
25-
for pid <- pids do
26-
Process.exit(pid, :normal)
27-
end
28-
end)
29-
end
30-
31-
setup do
32-
start_application_children()
33-
34-
comm_state = GenLSP.Buffer.comm_state(Expert.Buffer)
35-
36-
{:ok, port} = :inet.port(comm_state.lsocket)
37-
%{lsp: lsp} = :sys.get_state(Expert.Buffer)
38-
39-
expert = %{lsp: lsp, port: port}
40-
client = GenLSP.Test.client(expert)
41-
42-
[expert: expert, client: client]
43-
end
44-
45-
test "replies to initialize with expert info and capabilities", %{client: client} do
46-
id = System.unique_integer([:positive])
47-
48-
project = Fixtures.project()
49-
50-
root_uri = project.root_uri
51-
root_path = Forge.Project.root_path(project)
52-
53-
assert :ok ==
54-
GenLSP.Test.request(client, %{
55-
"id" => id,
56-
"jsonrpc" => "2.0",
57-
"method" => "initialize",
58-
"params" => %{
59-
"rootPath" => root_path,
60-
"rootUri" => root_uri,
61-
"capabilities" => %{},
62-
"workspaceFolders" => [
63-
%{
64-
uri: root_uri,
65-
name: root_path
66-
}
67-
]
68-
}
69-
})
70-
71-
GenLSP.Test.assert_result(^id, result, 500)
72-
73-
{:ok, initialize_result} =
74-
GenLSP.Requests.Initialize.result()
75-
|> Schematic.dump(Expert.State.initialize_result())
76-
77-
assert result == initialize_result
78-
end
79-
end
80-
817
test "sends an error message on engine initialization error" do
828
with_patched_transport()
839

0 commit comments

Comments
 (0)