-
Notifications
You must be signed in to change notification settings - Fork 21
testing: adding default values test cases for cpp #189
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
base: main
Are you sure you want to change the base?
testing: adding default values test cases for cpp #189
Conversation
|
#171 |
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds C++ test scenarios for default values functionality to achieve parity with existing Rust tests, enabling parameterized testing across both languages. The implementation includes a workaround to generate hash files for C++ KVS validation requirements.
Key changes:
- Added C++ test scenarios for default values (default_values, remove_key, reset operations, checksum)
- Implemented helper utilities for KVS parameter parsing and instance creation
- Modified Python test assertions to accommodate both Rust and C++ execution modes with known bug workarounds
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/python_test_cases/tests/test_cit_default_values.py | Extended parametrization to include "cpp", added FAILURE result code handling, and inserted xfail markers for known C++ bugs |
| tests/python_test_cases/tests/common.py | Added FAILURE result code constant |
| tests/cpp_test_scenarios/src/main.cpp | Integrated default values test group into scenario hierarchy |
| tests/cpp_test_scenarios/src/helpers/kvs_parameters.hpp | Created parameter parsing helper with JSON deserialization and defaults file validation |
| tests/cpp_test_scenarios/src/helpers/kvs_instance.hpp | Created KVS instance builder helper with parameter-based configuration |
| tests/cpp_test_scenarios/src/cit/test_default_values.hpp | Declared five scenario classes for default values testing |
| tests/cpp_test_scenarios/src/cit/test_default_values.cpp | Implemented all default values test scenarios with Python-compatible logging |
| tests/cpp_test_scenarios/BUILD | Changed to glob pattern for source files and added includes directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
914957a to
32679c8
Compare
| copts = [ | ||
| "-g", | ||
| ], | ||
| includes = ["src"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think You need to define includes when .hpp are defined by srcs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have sub-folders for helpers function.
We either need to give relative path using "../sub-folder/header" or add includes to let all the files find the header.
Giving relation path vs adding includes: the cleaner method would be adding includes.
|
|
||
| #include <kvs.hpp> | ||
|
|
||
| namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make an anonymous namespace in a .hpp file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes of this helper functions repeating in name is very low, so namespaces here are not really necessary. Removed them.
|
|
||
| #include "scenario.hpp" | ||
|
|
||
| namespace test_default_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if You really need namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked for that to keep the namespace clean. Main will be aggregating all the tests and some clashes in the future could happen.
| namespace test_default_values | ||
| { | ||
|
|
||
| constexpr double kFloatEpsilon = 1e-6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those definitions here are a good match for anonymous namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main will be aggregating all the tests and some clashes in the future could happen so giving them a name would make it cleaner , i feel.
igorostrowskiq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the merge, should be squashed to a single commit testing: <description>
9b9e5cd to
6ba9b41
Compare
- Added C++ test scenarios for default values testing - default_values, remove_key, reset operations, checksum
6ba9b41 to
77bb280
Compare
This PR adds C++ test cases for default values scenarios to achieve parity with existing Rust tests. The implementation includes a temporary workaround to create hash files for C++ KVS, which requires them for validation (unlike Rust). The changes enable parameterized testing across both Rust and C++ versions.
Key changes:
Added C++ test scenarios for default values testing (default_values, remove_key, reset operations, checksum)
Created the issue at : #170