Testcontainers for NebulaGraph
Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
NebulaGraph is a popular open-source graph database that can handle large volumes of data with milliseconds of latency, scale up quickly, and have the ability to perform fast graph analytics. NebulaGraph has been widely used for social media, recommendation systems, knowledge graphs, security, capital flows, AI, etc.
Introduction
Support Java 8+, Scala 3, Scala 2.13 and Scala 2.12
sbt:
"io.github.jxnu-liguobin" %% "testcontainers-nebula" % 'latest version' % Test
maven:
<dependency>
<groupId>io.github.jxnu-liguobin</groupId>
<artifactId>testcontainers-nebula_2.13</artifactId>
<version>'latest version'</version>
<scope>test</scope>
</dependency>
gradle:
testImplementation group: 'io.github.jxnu-liguobin', name: 'testcontainers-nebula_2.13', version: 'latest version'
Usage Instructions
Java example: SimpleNebulaCluster
ZIO example: NebulaSpec
The zio module provides default configurations for better integration with zio-nebula, just adding dependency:
"io.github.jxnu-liguobin" %% "testcontainers-nebula-zio" % 'latest version'
// testcontainers-nebula-zio depends on zio-nebula dependency
"io.github.jxnu-liguobin" %% "zio-nebula" % 'latest version'
Details:
NebulaSimpleClusterContainer.scala
creates four container instances: graphd,metad,storaged,console.NebulaClusterContainer.scala
provides a generic definition, and any number of clusters can be created by implementing its abstraction methods, ports and volumes can be modified.