Skip to content

Conversation

@Saumya-R
Copy link
Contributor

@Saumya-R Saumya-R commented Dec 11, 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)

Created the issue at : #170

@Saumya-R
Copy link
Contributor Author

#171
All the review comments from the PR tagged here are addressed here.

@github-actions
Copy link

github-actions bot commented Dec 11, 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: e6de08c6-c573-4519-9d51-b5362fd1c9c2
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: 
WARNING: For repository 'rules_rust', the root module requires module version rules_rust@0.56.0, but got rules_rust@0.61.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.1.2 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: 5 packages loaded
Loading: 5 packages loaded
    currently loading: 
Analyzing: target //:license-check (6 packages loaded, 0 targets configured)
Analyzing: target //:license-check (6 packages loaded, 0 targets configured)

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

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

Analyzing: target //:license-check (157 packages loaded, 2244 targets configured)

Analyzing: target //:license-check (163 packages loaded, 6985 targets configured)

Analyzing: target //:license-check (166 packages loaded, 9001 targets configured)

INFO: Analyzed target //:license-check (166 packages loaded, 9001 targets configured).
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: 22.983s, Critical Path: 0.44s
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

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

copts = [
"-g",
],
includes = ["src"],
Copy link
Contributor

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.

Copy link
Contributor Author

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

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?

Copy link
Contributor Author

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

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?

Copy link
Contributor

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

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@igorostrowskiq igorostrowskiq left a 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>

@Saumya-R Saumya-R force-pushed the saumya_default_values_test_cases branch from 9b9e5cd to 6ba9b41 Compare December 17, 2025 10:42
- Added C++ test scenarios for default values testing
- default_values, remove_key, reset operations, checksum
@Saumya-R Saumya-R force-pushed the saumya_default_values_test_cases branch from 6ba9b41 to 77bb280 Compare December 17, 2025 10:49
@Saumya-R Saumya-R changed the title adding default values test cases for cpp testing: adding default values test cases for cpp Dec 17, 2025
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