Skip to content

Comments

Test Case for Default Values scenario for CPP added #35

Closed
Saumya-R wants to merge 9 commits intomainfrom
saumya_cpp_test_update
Closed

Test Case for Default Values scenario for CPP added #35
Saumya-R wants to merge 9 commits intomainfrom
saumya_cpp_test_update

Conversation

@Saumya-R
Copy link

@Saumya-R Saumya-R commented Nov 18, 2025

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.

SaumyaRai and others added 4 commits November 10, 2025 12:39
In the pytest there is a generation of hash files for cpp cases . will be removed once the cpp bug is fixed.
@Saumya-R Saumya-R self-assigned this Nov 18, 2025
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 4626c552-0089-4375-bf3a-0c6ab7f96a63
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rust_qnx8_toolchain+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-oEubHgeZDdT0svMmBKJx7c3/2TdSI/vfwRUyDn+TPGA="
DEBUG: Repository rust_qnx8_toolchain+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
DEBUG: Rule 'rules_boost+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-iKHWUIBrUN/fFOCltkTmHfDcKw0h4ZVmP7NVSoc8zBs="
DEBUG: Repository rules_boost+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.15.0, but got googletest@1.17.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'platforms', the root module requires module version platforms@0.0.11, but got platforms@1.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 2 packages loaded
Loading: 2 packages loaded
    currently loading: 
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)

Analyzing: target //:license-check (77 packages loaded, 9 targets configured)

Analyzing: target //:license-check (137 packages loaded, 2408 targets configured)

Analyzing: target //:license-check (143 packages loaded, 2564 targets configured)

Analyzing: target //:license-check (145 packages loaded, 2569 targets configured)

Analyzing: target //:license-check (146 packages loaded, 4571 targets configured)

DEBUG: Rule 'toolchains_llvm++llvm+llvm_toolchain_llvm' indicated that a canonical reproducible form can be obtained by modifying arguments _action_listener = <unknown object com.google.devtools.build.lib.packages.Attribute$LabelListLateBoundDefault>, _config_dependencies = [], _configure = False, _environ = [], _original_name = "llvm_toolchain_llvm"
DEBUG: Repository toolchains_llvm++llvm+llvm_toolchain_llvm instantiated at:
  <builtin>: in <toplevel>
Repository rule llvm defined at:
  /home/runner/.bazel/external/toolchains_llvm+/toolchain/rules.bzl:27:23: in <toplevel>
Analyzing: target //:license-check (146 packages loaded, 4571 targets configured)

INFO: Analyzed target //:license-check (147 packages loaded, 6506 targets configured).
[6 / 13] [Prepa] Writing repo mapping manifest for //:license.check.license_check
[10 / 14] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 65 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 208.635s, Critical Path: 0.45s
INFO: 14 processes: 5 disk cache hit, 9 internal.
INFO: Build completed successfully, 14 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

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.
Copy link

Copilot AI left a 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 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.

Comment on lines +89 to +90
# Path to the Rust test binary
return "<rust_test_binary_path>" # TODO: set actual path
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
# 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.")

Copilot uses AI. Check for mistakes.
Copy link

@PiotrKorkus PiotrKorkus left a comment

Choose a reason for hiding this comment

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

Move this PR directly to score repo

@Saumya-R Saumya-R requested a review from Copilot November 19, 2025 07:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
return "<rust_test_binary_path>" # TODO: set actual path
return "../rust_test_scenarios/bin/rust_test_scenarios" # Adjust as needed

Copilot uses AI. Check for mistakes.
@Saumya-R Saumya-R closed this Nov 19, 2025
@Saumya-R Saumya-R deleted the saumya_cpp_test_update branch November 19, 2025 08:32
@Saumya-R Saumya-R added the duplicate This issue or pull request already exists label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants