Skip to content

Commit

Permalink
Update Dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnu-liguobin committed Oct 10, 2023
1 parent 17595dd commit ada38b2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ val scala2_12Version = "2.12.18"
val testcontainersVersion = "1.19.0"
val scalaCollectionCompatVersion = "2.11.0"
val logbackVersion = "1.4.2"
val nebulaJavaClientVersion = "3.6.0"
val zioNebulaVersion = "0.1.0"
val nebulaJavaClientVersion = "3.6.1"
val zioNebulaVersion = "0.1.1"

val supportCrossVersionList = Seq(scala3_Version, scala2_13Version, scala2_12Version)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package testcontainers.containers.znebula

import zio.ZIO
import zio.{ Scope, ZIO }
import zio.nebula._
import zio.nebula.meta._
import zio.nebula.storage._
Expand Down Expand Up @@ -35,18 +35,33 @@ object NebulaClientSpec extends NebulaSpec {
|MATCH (p:person) RETURN p LIMIT 4;
|""".stripMargin

lazy val session = ZioNebulaEnvironment.defaultSession(container.graphdHostList.head, container.graphdPortList.head)

def specLayered: Spec[Nebula, Throwable] =
suite("nebula suite")(
suite("nebula session pool")(
test("create and query") {
for {
init <- ZIO.serviceWithZIO[NebulaSessionClient](_.init())
_ <- ZIO.logInfo(s"init session: $init")
res1 <- ZIO.serviceWithZIO[NebulaSessionClient](_.execute(insertVertexes))
res1 <- ZIO
.serviceWithZIO[NebulaSessionClient](_.execute(insertVertexes))
.provide(
Scope.default,
session
)
_ <- ZIO.logInfo(s"exec insert vertex: ${res1.errorMessage}")
res2 <- ZIO.serviceWithZIO[NebulaSessionClient](_.execute(insertEdges))
res2 <- ZIO
.serviceWithZIO[NebulaSessionClient](_.execute(insertEdges))
.provide(
Scope.default,
session
)
_ <- ZIO.logInfo(s"exec insert edge: ${res2.errorMessage}")
res3 <- ZIO.serviceWithZIO[NebulaSessionClient](_.execute(query))
res3 <- ZIO
.serviceWithZIO[NebulaSessionClient](_.execute(query))
.provide(
Scope.default,
session
)
_ <- ZIO.logInfo(s"exec query ${res3.errorMessage}")
} yield assertTrue(res3.rows.size == 4)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import testcontainers.containers.znebula.ext._

trait NebulaSpec extends ZIOSpecDefault {

type Nebula = Client with SessionClient with Storage with Meta with Scope
type Nebula = Client with Storage with Meta with Scope

zio.nebula.GlobalSettings.printStatement = true
zio.nebula.GlobalSettings.logLevel = LogLevel.Warning
Expand All @@ -25,10 +25,9 @@ trait NebulaSpec extends ZIOSpecDefault {
println(container.metadUrlList)
println(container.graphdUrlList)

val meta = ZioNebulaEnvironment.defaultMeta(container.metadHostList.head, container.metadPortList.head)
val client = ZioNebulaEnvironment.defaultClient(container.graphdHostList.head, container.graphdPortList.head)
val sessionClient = ZioNebulaEnvironment.defaultSession(container.graphdHostList.head, container.graphdPortList.head)
val storage = ZioNebulaEnvironment.defaultStorage(container.metadHostList.head, container.metadPortList.head)
val meta = ZioNebulaEnvironment.defaultMeta(container.metadHostList.head, container.metadPortList.head)
val client = ZioNebulaEnvironment.defaultClient(container.graphdHostList.head, container.graphdPortList.head)
val storage = ZioNebulaEnvironment.defaultStorage(container.metadHostList.head, container.metadPortList.head)

override def spec =
(specLayered @@ beforeAll(
Expand All @@ -50,7 +49,6 @@ trait NebulaSpec extends ZIOSpecDefault {
Scope.default,
meta,
client,
sessionClient,
storage
)

Expand Down

0 comments on commit ada38b2

Please sign in to comment.