Skip to content

Commit 410e6c6

Browse files
authored
Remove excessive diagnostics flags, turn on development mode for tests (#659)
## Usage and product changes We clean the usage of `--diagnostics.***` flags used in the test servers because of the recent propagation of a newer version of `TypeDB`, now supporting the `--development-mode.enable` flag. As the development mode includes disabling any outer reporting, it is a perfect substitution for this logic. ## Implementation We remove the unnecessary flags everywhere, aiming to cover it by the activated development mode. * This mode is activated by default for all the `TypeDB***Runner`s [relevant for the `Java` driver] * This mode is **not** activated for `vaticle_typedb_artifact` fetched by `vaticle_typedb_artifact()` or built by `bazel build @vaticle_typedb_artifact_*platform*//file`, so we need to manually add `--development-mode.enable=true` for all the invocations of these artifacts.
1 parent f4aa116 commit 410e6c6

File tree

15 files changed

+19
-39
lines changed

15 files changed

+19
-39
lines changed

.circleci/windows/clib/test_assembly.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cmake --build . --config release
3535
popd
3636
set PATH=%cd%\test_assembly_clib\typedb-driver-clib-windows-x86_64\lib;%PATH%;
3737

38-
START /B "" typedb-server-windows\typedb server --diagnostics.reporting.statistics=false --diagnostics.reporting.errors=false
38+
START /B "" typedb-server-windows\typedb server --development-mode.enable=true
3939
powershell -Command "Start-Sleep -Seconds 10"
4040

4141
test_assembly_clib\Release\test_assembly.exe

.circleci/windows/cpp/test_assembly.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cmake --build . --config release
3535
popd
3636
set PATH=%cd%\test_assembly_cpp\typedb-driver-cpp-windows-x86_64\lib;%PATH%;
3737

38-
START /B "" typedb-server-windows\typedb server --diagnostics.reporting.statistics=false --diagnostics.reporting.errors=false
38+
START /B "" typedb-server-windows\typedb server --development-mode.enable=true
3939
powershell -Command "Start-Sleep -Seconds 10"
4040

4141
test_assembly_cpp\Release\test_assembly.exe

.circleci/windows/csharp/test_deploy_snapshot.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ powershell -Command "Move-Item -Path bazel-typedb-driver\external\vaticle_typedb
2525
7z x typedb-server-windows.zip
2626
RD /S /Q typedb-server-windows
2727
powershell -Command "Move-Item -Path typedb-server-windows-* -Destination typedb-server-windows"
28-
START /B "" typedb-server-windows\typedb server --diagnostics.reporting.statistics=false --diagnostics.reporting.errors=false
28+
START /B "" typedb-server-windows\typedb server --development-mode.enable=true
2929

3030
powershell -Command "(gc csharp\Test\Deployment\NugetApplicationTest.csproj) -replace 'DRIVER_CSHARP_VERSION_MARKER', '0.0.0-%CIRCLE_SHA1%' | Out-File -encoding ASCII csharp\Test\Deployment\NugetApplicationTest.csproj"
3131
type csharp\Test\Deployment\NugetApplicationTest.csproj

.circleci/windows/java/test_deploy_snapshot.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ powershell -Command "Move-Item -Path bazel-typedb-driver\external\vaticle_typedb
2525
7z x typedb-server-windows.zip
2626
RD /S /Q typedb-server-windows
2727
powershell -Command "Move-Item -Path typedb-server-windows-* -Destination typedb-server-windows"
28-
START /B "" typedb-server-windows\typedb server --diagnostics.reporting.statistics=false --diagnostics.reporting.errors=false
28+
START /B "" typedb-server-windows\typedb server --development-mode.enable=true
2929

3030
powershell -Command "(gc java\test\deployment\pom.xml) -replace 'DRIVER_JAVA_VERSION_MARKER', '0.0.0-%CIRCLE_SHA1%' | Out-File -encoding ASCII java\test\deployment\pom.xml"
3131
type java\test\deployment\pom.xml

.circleci/windows/python/test_deploy_snapshot.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ powershell -Command "Move-Item -Path bazel-typedb-driver\external\vaticle_typedb
2727
7z x typedb-server-windows.zip
2828
RD /S /Q typedb-server-windows
2929
powershell -Command "Move-Item -Path typedb-server-windows-* -Destination typedb-server-windows"
30-
START /B "" typedb-server-windows\typedb server --diagnostics.reporting.statistics=false --diagnostics.reporting.errors=false
30+
START /B "" typedb-server-windows\typedb server --development-mode.enable=true
3131

3232
python3 -m pip install --extra-index-url https://repo.typedb.com/public/public-snapshot/python/simple typedb-driver==0.0.0+%VER%
3333
cd python/tests/deployment

csharp/Test/Behaviour/Connection/ConnectionStepsBase.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ public abstract class ConnectionStepsBase : Feature, IDisposable
5252
{"transaction-timeout-millis", (option, val) => option.TransactionTimeoutMillis(Int32.Parse(val))}
5353
};
5454

55-
public static readonly Dictionary<string, string> ServerOptions =
56-
new Dictionary<string, string>(){
57-
{"--diagnostics.reporting.enable", "false"}
58-
};
59-
6055
// TODO: implement configuration and remove skips when @ignore-typedb-driver is removed from .feature.
6156
protected bool _requiredConfiguration = false;
6257

dependencies/vaticle/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def vaticle_typedb_protocol():
3636
name = "vaticle_typedb_protocol",
3737
remote = "https://github.com/vaticle/typedb-protocol",
3838
# NOTE: the sync-marker is also used for workspace status by Bazel!
39-
commit = "aea498d852d763c20d9ecc7d11423d7506964b95", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_protocol
39+
tag = "2.28.4", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_protocol
4040
)
4141

4242
def vaticle_typedb_behaviour():

java/test/behaviour/connection/ConnectionStepsBase.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.vaticle.typedb.driver.api.database.Database;
2828

2929
import java.util.ArrayList;
30+
import java.util.Collections;
3031
import java.util.HashMap;
3132
import java.util.List;
3233
import java.util.Map;
@@ -60,11 +61,7 @@ public abstract class ConnectionStepsBase {
6061
pair("transaction-timeout-millis", (option, val) -> option.transactionTimeoutMillis(Integer.parseInt(val)))
6162
);
6263

63-
public static final Map<String, String> serverOptions = map(
64-
pair("--diagnostics.reporting.errors", "false"),
65-
pair("--diagnostics.reporting.statistics", "false"),
66-
pair("--diagnostics.monitoring.enable", "false")
67-
);
64+
public static final Map<String, String> serverOptions = Collections.emptyMap();
6865

6966
public static TypeDBTransaction tx() {
7067
return sessionsToTransactions.get(sessions.get(0)).get(0);

java/test/integration/AddressTranslationTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,11 @@
4747
public class AddressTranslationTest {
4848
private static final Logger LOG = LoggerFactory.getLogger(AddressTranslationTest.class);
4949

50-
private static final Map<String, String> serverOptions = map(
51-
pair("--diagnostics.reporting.errors", "false"),
52-
pair("--diagnostics.reporting.statistics", "false"),
53-
pair("--diagnostics.monitoring.enable", "false")
54-
);
5550
private static final TypeDBCredential credential = new TypeDBCredential("admin", "password", false);
5651

5752
@Test
5853
public void testAddressTranslation() {
59-
TypeDBCloudRunner typedb = TypeDBCloudRunner.create(Paths.get("."), 3, serverOptions);
54+
TypeDBCloudRunner typedb = TypeDBCloudRunner.create(Paths.get("."), 3);
6055
typedb.start();
6156
Map<String, String> addresses = typedb.externalAddresses().stream().map(address -> pair(address, address))
6257
.collect(Collectors.toMap(Pair::first, Pair::second));

java/test/integration/DriverQueryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ public class DriverQueryTest {
7171

7272
@BeforeClass
7373
public static void setUpClass() throws InterruptedException, IOException, TimeoutException {
74-
Map<String, String> options = new HashMap<>();
75-
options.put("--diagnostics.reporting.errors", "false");
76-
options.put("--diagnostics.reporting.statistics", "false");
77-
typedb = new TypeDBCoreRunner(options);
74+
typedb = new TypeDBCoreRunner();
7875
typedb.start();
7976
typedbDriver = TypeDB.coreDriver(typedb.address());
8077
if (typedbDriver.databases().contains("typedb")) typedbDriver.databases().get("typedb").delete();

0 commit comments

Comments
 (0)