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

Move remaining tests and build/run all legacy tests using CMake #26

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Jun 25, 2024

This PR moves the remaining tests, i.e. the cluster tests, to the new project structure
and enables building and running all tests using CMake.

      mkdir build && cd build
      cmake -DENABLE_SSL=ON -DENABLE_IPV6_TESTS=ON ..
      make
      make test

The cluster tests are a bit more complex to build and run than the non-cluster,
so currently the repo provided Makefile will only build the non-cluster tests.
This can probably be improved in the near future.

The legacy CMake options ENABLE_SSL_TESTS and ENABLE_ASYNC_TESTS are removed.
This is now instead controlled by the build option ENABLE_SSL and if libevent is available.

Closes #12

Builds the non-cluster and all cluster tests via CMake,
and run them via ctest.

Example:
  mkdir build && cd build
  cmake -DENABLE_SSL=ON -DENABLE_IPV6_TESTS=ON ..
  make
  make test

Signed-off-by: Björn Svensson <[email protected]>
@bjosv
Copy link
Collaborator Author

bjosv commented Jun 25, 2024

Ouch, I couldn't add the binary test from test.c as a target in CMake since its already used by ctest.

I had to set the outputname like set_target_properties(libvalkey-test PROPERTIES OUTPUT_NAME "test")
..which works with Make but not with ninja, as it seems.
I didn't test ninja locally but of course it now fails in CI..

Copy link
Collaborator

@michael-grunder michael-grunder left a comment

Choose a reason for hiding this comment

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

Looks good

@bjosv
Copy link
Collaborator Author

bjosv commented Jun 25, 2024

Naming suggestions for the binary are welcomed, naming is the hard part :)

@michael-grunder
Copy link
Collaborator

Naming suggestions for the binary are welcomed, naming is the hard part :)

client_test works for me. It is mostly what those tests are doing.

@bjosv bjosv merged commit 8cd807d into valkey-io:main Jun 25, 2024
8 of 40 checks passed
@bjosv bjosv deleted the move-cluster-tests branch June 25, 2024 18:11
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.

Move tests to tests/
2 participants