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

Hardcoded postgresql configuration in VectorAPIUTest #2709

Open
mmmkkaaayy opened this issue Jun 24, 2020 · 3 comments
Open

Hardcoded postgresql configuration in VectorAPIUTest #2709

mmmkkaaayy opened this issue Jun 24, 2020 · 3 comments

Comments

@mmmkkaaayy
Copy link

mmmkkaaayy commented Jun 24, 2020

When I run unit tests with make -j8 test, all tests except 92/154 (VectorAPIUTest) pass.

The error at the top of the stack trace is:

Cannot connect to database: FATAL:  password authentication failed for user "opencog_tester"

I've traced it to this line of code

rc = eval->eval("(sql-open \"postgres:///opencog_test?user=opencog_tester&password=cheese\")");

When I modify it with the correct credentials, the test passes. Should this be trying to read creds from lib/atomspace-test.conf instead?

Note that there's another instance of this hardcoded creds later on in the file, but I didn't need to change that to get the test passing:

rc = eval->eval("(sql-open \"postgres:///opencog_test?user=opencog_tester&password=cheese\")");

Side question: How do I run a specific test instead of running all tests with make -j8 test?

@linas
Copy link
Member

linas commented Jun 24, 2020

Should this be trying to read creds from lib/atomspace-test.conf instead?

Yes. And the easiest way to do that would be to add a fourth line:

TEST_DB_URL = "postgres:///opencog_test?user=opencog_tester&password=cheese"

Side question:

You can name tests individually, e.g. say ./tests/matrix/VectorAPIUTest from the build directory.

There are also four custom targets to run subsests of the unit tests make test_query, make test_python a few others (adding them to README now). There is no test-sql-only target, but I will add that now.

@mmmkkaaayy
Copy link
Author

Wouldn't it be better to use config.get() like the other sql tests? That way the dev doesn't have to do an extra step to get all tests passing.

@linas
Copy link
Member

linas commented Jun 25, 2020

Yes, I meant config.get()

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