-
Notifications
You must be signed in to change notification settings - Fork 14
Implement and publish typedb runners for supported languages #147
Description
Problem to Solve
We currently only support a TypeDB Runner library for Java. However, for our own consumption and testing of clients across multiple languages, and community testing of their own TypeDB usage, it is extremely useful to have programmatic access to starting/stopping/configuring a TypeDB instance.
Current Workaround
In non-Java languages, we either use a custom Bazel rule to unzip and run a TypeDB instance (eg. https://github.com/vaticle/typedb-client-python/blob/376aa6b6a5b0b64d9f1c4ea578792bc341e1cc59/tools/behave_rule.bzl#L32) or in the worst case boot up the server as a separate CI step.
In Java, we have an actual test runner that allows bootup with of TypeDB Cluster with server configurations: https://github.com/vaticle/typedb-common/blob/2e305a5674a173894e1109a2a9b7b5ab51e79077/test/cluster/TypeDBClusterRunner.java#L56
Proposed Solution
We propose a small project made up of several parts:
- come up with a unified API for booting both Cluster and Core via a runner library that consumes a TypeDB distribution
- implement this API once in Rust as a published library, usable by ourselves and our community
- expose an FFI and JNI binding for the runner library that allows wrapping the API for Python, Node, and Java
- publish the Python, Node, and Java libraries to their respective repositories.
We foresee that this work could live in the typedb-common repository, after we make it multi-language. In particular, we could have //test/runner/(rust|python|node|java) and publish each artifact from CI.
Additional Information
Once this has been implemented, we can unignore User testing in client-python and client-nodejs, which require a configurable bootup step. These @ignore-* can be found at: https://github.com/vaticle/typedb-behaviour/blob/master/connection/user.feature
Once this has been implemented, the runners should be fully utilised to match the client-java usage of the runners for BDD test, including resetting the runner between each scenario. See typedb/typedb-driver#408 and its follow ups for the intended effect.