Skip to content

Commit

Permalink
debug ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fox0430 committed Oct 24, 2024
1 parent 92138f1 commit beb2553
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/texmode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ suite "Ex mode: Write command":
const Command = @[ru"w"]
status.exModeCommand(Command)

discard lspClient.kill

suite "Ex mode: Change next buffer command":
test "Change next buffer command 1":
var status = initEditorStatus()
Expand Down
24 changes: 19 additions & 5 deletions tests/tlspclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# #
#[############################################################################]#

import std/[unittest, importutils, os, osproc, options, tables, json]
import std/[unittest, importutils, os, osproc, options, tables, json, strformat]

import pkg/results

Expand Down Expand Up @@ -93,12 +93,23 @@ suite "lsp: restart":
Command = "nimlangserver"
Trace = TraceValue.verbose

var client: LspClient
var
client: LspClient
beforePid: int

setup:
beforePid = -1

if isNimlangserverAvailable():
client = (waitFor initLspClient(Command)).get

teardown:
if beforePid > -1:
discard execCmd(fmt"kill -9 {$beforePid}")

if client.serverProcessId > -1:
discard execCmd(fmt"kill -9 {$client.serverProcessId}")

test "Basic 1":
if not isNimlangserverAvailable():
skip()
Expand All @@ -107,9 +118,9 @@ suite "lsp: restart":
let params = initInitializeParams(ServerName, "/", Trace)
check (waitFor client.initialize(BufferId, params)).isOk

let
beforePid = client.serverProcessId
beforeLogLen = client.log.len
beforePid = client.serverProcessId

let beforeLogLen = client.log.len

check client.running

Expand Down Expand Up @@ -1183,6 +1194,9 @@ suite "lsp: Send requests":
if dirExists(rootDir):
removeDir(rootDir)

if client.serverProcessId > -1:
echo execCmdEx(fmt"kill -9 {$client.serverProcessId}")

test "Send initialize":
if not isNimlangserverAvailable():
skip()
Expand Down

0 comments on commit beb2553

Please sign in to comment.