Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/test looks for bedrock in the PATH #1618

Open
tangentsoft opened this issue Nov 18, 2023 · 4 comments
Open

test/test looks for bedrock in the PATH #1618

tangentsoft opened this issue Nov 18, 2023 · 4 comments

Comments

@tangentsoft
Copy link

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;
     }
@fukawi2
Copy link
Contributor

fukawi2 commented Nov 19, 2023

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

@tangentsoft
Copy link
Author

Two bytes? C'mon…

@fukawi2
Copy link
Contributor

fukawi2 commented Nov 20, 2023

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

@tangentsoft
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants