mirror of https://github.com/sbt/sbt.git
Merge pull request #4427 from andreaTP/flakyCompletionsSpec
fix ServerSpec flaky test
This commit is contained in:
commit
23063e2813
|
|
@ -5,3 +5,4 @@ node_modules
|
|||
vscode-sbt-scala/client/server
|
||||
npm-debug.log
|
||||
*.vsix
|
||||
!sbt/src/server-test/completions/target
|
||||
|
|
|
|||
|
|
@ -2,5 +2,3 @@
|
|||
val hello = taskKey[Unit]("Say hello")
|
||||
|
||||
hello := {}
|
||||
|
||||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5"
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package org.sbt
|
||||
|
||||
import org.scalatest.FlatSpec
|
||||
|
||||
class ExampleSpec extends FlatSpec {
|
||||
"a test" should "do something" in {
|
||||
assert(true == true)
|
||||
assert(false == false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
["org.sbt.ExampleSpec"]
|
||||
|
|
@ -128,20 +128,12 @@ class ServerSpec extends fixture.AsyncFreeSpec with fixture.AsyncTestDataFixture
|
|||
|
||||
"return completions for user classes" in { implicit td =>
|
||||
withTestServer("completions") { p =>
|
||||
p.sendJsonRpc(
|
||||
"""{ "jsonrpc": "2.0", "id":12, "method": "sbt/exec", "params": { "commandLine": "test" } }"""
|
||||
)
|
||||
|
||||
p.waitForString(30) { s =>
|
||||
(s contains """"id":12,"result":{"status":"Done"""") && (s contains """"exitCode":0""")
|
||||
}
|
||||
|
||||
val completionStr = """{ "query": "testOnly org." }"""
|
||||
p.sendJsonRpc(
|
||||
s"""{ "jsonrpc": "2.0", "id": 15, "method": "sbt/completion", "params": $completionStr }"""
|
||||
)
|
||||
|
||||
assert(p.waitForString(30) { s =>
|
||||
assert(p.waitForString(10) { s =>
|
||||
s contains """"result":{"items":["testOnly org.sbt.ExampleSpec"]}"""
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue