Bedrock icon indicating copy to clipboard operation
Bedrock copied to clipboard

`test/test` looks for `bedrock` in the `PATH`

Open tangentsoft opened this issue 1 year ago • 4 comments

After building the server program for the first time, bedrock is in the top-level source directory but not yet installed. If you then say test/test, you get this error:

Starting bedrock failed. Errno: 2, msg: No such file or directory, serverName: bedrock bedrock -cacheSize 1000 -commandPortPrivate 0.0.0.0:10003 -controlPort localhost:10002 -db /tmp/bedrocktest_RdhqPz.db -enableMultiWrite true -escalateOverHTTP true -extraExceptionLogging -maxJournalSize 25000 -mmapSizeGB 1 -nodeHost localhost:10001 -nodeName bedrock_test -parallelReplication true -plugins Jobs,DB -priority 200 -serverHost 127.0.0.1:10000 -testName CancelJob -v -workerThreads 8

This is because it is defaulting to "bedrock", which doesn't exist in the PATH, as consulted by execvp() in test/lib/BedrockTester.cpp.

Since testing the binary before installing it is a good plan, I suggest applying this trivial patch:

diff --git a/test/lib/BedrockTester.cpp b/test/lib/BedrockTester.cpp
index fe74c833..fff22a46 100644
--- a/test/lib/BedrockTester.cpp
+++ b/test/lib/BedrockTester.cpp
@@ -58,7 +58,7 @@ BedrockTester::BedrockTester(const map<string, string>& args,
     }
 
     if (bedrockBinary.empty()) {
-        serverName = "bedrock";
+        serverName = "./bedrock";
     } else {
         serverName = bedrockBinary;
     }

tangentsoft avatar Nov 18 '23 19:11 tangentsoft

Thanks for reporting this! This seems like a reasonable change to me - would you be willing to put up a PR for it? :)

fukawi2 avatar Nov 19 '23 22:11 fukawi2

Two bytes? C'mon…

tangentsoft avatar Nov 20 '23 03:11 tangentsoft

I know it seems silly, but I can't approve my own PR :)

fukawi2 avatar Nov 20 '23 04:11 fukawi2

No, but you can commit it and hog all the credit for the innovation, and it will be perfectly fine with me. :)

tangentsoft avatar Nov 20 '23 04:11 tangentsoft