Test Case for Default Values scenario for CPP added #35
Test Case for Default Values scenario for CPP added #35
Conversation
In the pytest there is a generation of hash files for cpp cases . will be removed once the cpp bug is fixed.
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 |
…updated. The pytest fixture is currently forced to add hash files for CPP test cases , as there is a bug reported.
There was a problem hiding this comment.
Pull Request Overview
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)
- Implemented temporary hash file generation in Python test fixtures to support C++ requirements
- Modified Rust test scenarios to use string-based result logging for cross-language compatibility
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rust_test_scenarios/src/cit/default_values.rs | Changed error handling from expect() to match expressions with formatted string results |
| tests/python_test_cases/tests/test_cit_default_values.py | Added C++ to parameterized tests, implemented Adler32 hash generation, updated assertions for string-based results |
| tests/python_test_cases/tests/conftest.py | Added pytest hook to warn about missing defaults files |
| tests/cpp_test_scenarios/src/test_basic.cpp | Minor formatting changes to improve readability |
| tests/cpp_test_scenarios/src/main.cpp | Added default values scenario support, improved error handling and return codes |
| tests/cpp_test_scenarios/src/helpers/kvs_parameters.hpp | New helper for parsing KVS parameters from JSON with defaults file validation |
| tests/cpp_test_scenarios/src/helpers/kvs_instance.hpp | New helper for creating KVS instances from parameters |
| tests/cpp_test_scenarios/src/cit/test_default_values.hpp | Header declaring C++ default values test scenarios |
| tests/cpp_test_scenarios/src/cit/test_default_values.cpp | Implementation of C++ default values test scenarios |
| tests/cpp_test_scenarios/BUILD | Added new source files to build configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Path to the Rust test binary | ||
| return "<rust_test_binary_path>" # TODO: set actual path |
There was a problem hiding this comment.
The get_binary method returns a placeholder path for Rust. This TODO should be addressed or the method should raise NotImplementedError if the Rust path configuration is pending.
| # Path to the Rust test binary | |
| return "<rust_test_binary_path>" # TODO: set actual path | |
| # Rust binary path not configured yet | |
| raise NotImplementedError("Rust binary path is not configured. Please set the actual path.") |
PiotrKorkus
left a comment
There was a problem hiding this comment.
Move this PR directly to score repo
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def get_binary(self, version: str) -> str: | ||
| if version == "rust": | ||
| # Path to the Rust test binary | ||
| return "<rust_test_binary_path>" # TODO: set actual path |
There was a problem hiding this comment.
The placeholder path '<rust_test_binary_path>' needs to be replaced with an actual path or this method needs to be completed. This TODO suggests incomplete functionality.
| return "<rust_test_binary_path>" # TODO: set actual path | |
| return "../rust_test_scenarios/bin/rust_test_scenarios" # Adjust as needed |
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)
Implemented temporary hash file generation in Python test fixtures to support C++ requirements
Modified Rust test scenarios to use string-based result logging for cross-language compatibility
The CPP KVS needs a hash file which is not needed by RUST , leading to failure of test cases.
Currently a patch in the pytest fixture is added to create the hash files for Cpp test cases to execute.