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

Change Ctest to no longer run and kill gaia_db_server #1501

Merged
merged 5 commits into from
May 3, 2022

Conversation

simone-gaia
Copy link
Contributor

The fact that ctest was running and killing gaia_db_server, was not ideal but acceptable. Unfortunately, after introducing the new benchmark framework, the gaia_db_server instance run by ctest interferes with the instance run by the benchmarks.

For this reason, I decided to remove the CTestCustom.cmake logic.

  • Remove the CTestCustom.cmake that runs and kills the server.
  • Adapt the SDK tests to run and kill the server themselves.
  • Disable Java & Python tests that rely on the running server.
  • Move Java stuff into its own folder.

@@ -39,6 +37,12 @@ option(DISABLE_CCACHE "Disable ccache unconditionally" OFF)

option(ENABLE_CLANG_TIDY "Enable Clang-Tidy to be specified externally")

# Disabled by default because: https://gaiaplatform.atlassian.net/browse/GAIAPLAT-2157.
Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just have some standard tests start a default Gaia server instance and then execute the Python/Java wrapper tests against it? This would be a bit like how we execute the FDW tests, except here you'd just have to execute the Python/Java test applications without worrying about passing in any parameters.

NOTE: edited for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand what you mean. Yes, we can definitely run the server as part of those tests, I didn't want to spend time on it now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that it should be possible to execute these as you do the SDK tests.

I.e.:

  • in the google test setup, you launch the server instance, like you do for the SDK tests.
  • in the google test function, you execute the Python/Java test programs using system and just check for its return value. See verify_command_output helper in test_fdw.cpp, for example. And by executing the Python/Java test programs, I am thinking of running commands like python test.py and java Test.java.

Does this make more sense now?

static void SetUpTestSuite()
{
// Starts the server in a "public way".
system("../db/core/gaia_db_server --persistence disabled &");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could execute the Python/Java tests in this same way, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried with Java, got some problems, and thought it was easier to disable the tests altogether.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What problems did you encounter with Java?

What about Python? If you could keep at least one of those tests around, it would be better than not keeping either of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't try with Python. With Java, the problem was something related to the path to the server. I can try tomorrow. I have created a workaround to unlock #1481.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, the Java executable runs with the current directory being set to something else than the build folder?

I wouldn't want to disable support for these tests unless it's absolutely a pain. But the tests are so simple in their setup that it should be possible to keep them around - the only thing they needed is the default db instance, so if you're removing it from the test command and placing it into the test suite setup, that should already cover most of the challenge - we should just need to wrap the execution of the tests into a standard google test function.

Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we fix the Python/Java tests just like you did the SDK ones?

Copy link
Contributor

@daxhaw daxhaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to test_sdk* look fine.

Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my request to keep the wrapper tests working is too complicated, go ahead and merge these changes as they are. But if you can at least keep one of the tests around, I think it would help to have some coverage for the low-level DB API. Thanks!

@simone-gaia
Copy link
Contributor Author

If my request to keep the wrapper tests working is too complicated, go ahead and merge these changes as they are. But if you can at least keep one of the tests around, I think it would help to have some coverage for the low-level DB API. Thanks!

It was simple at the end of the day. Instead of running the server from within the test (which is a little more complicated), I managed to run the server from the CMake command that adds the tests.

@LaurentiuCristofor LaurentiuCristofor changed the title Ctest no longer run and kill gaia_db_server Change Ctest to no longer run and kill gaia_db_server May 3, 2022
@simone-gaia simone-gaia merged commit 44df4d1 into master May 3, 2022
@simone-gaia simone-gaia deleted the rondelli-disable-ctest-run-server branch May 3, 2022 16:06
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

Successfully merging this pull request may close these issues.

3 participants