-
-
Notifications
You must be signed in to change notification settings - Fork 308
Generate VOL tests for h5dump #5763
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: develop
Are you sure you want to change the base?
Conversation
98124ec
to
5dfa416
Compare
|
||
# Mask out the h5dump-assigned anonymous committed datatype numbers | ||
# Datatype number may have a forward slash before # | ||
list (APPEND filters_in "DATATYPE[ \t]*\"(/?#)[0-9]+\"") |
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'm somewhat iffy on this change, only because applying filters to the output for the native connector has the potential to mask real issues.
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 agree it's not a perfect solution, but given that verification is done through h5dump output containing these potentially inconsistent elements, I'm not aware of a cleaner solution. The way the masking is done leaves the files on-disk the same, so those can at least be checked directly to see e.g. real sizes and offsets. Only a few specifically marked tests apply these filters.
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.
My issue with this one is more about catching the issues at test time. Sure someone can always manually inspect the files, but they would need to know there is something wrong in the first place before deciding to do that.
The idea is that at least for the native VOL, the address/size/etc. of something changing in the file would be an interesting point to note. The test failure that would result could signal to the developer that something is wrong in the tools, or at least signal that files should be re-generated. This probably isn't too likely in practice, but it would be nice if we could avoid applying these filters for the native VOL.
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.
Approving as the masking of some values for the native VOL is a fairly minor issue, though it would be nice if it could be resolved. There's also a small conflict in the REST VOL workflow that needs resolved.
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.
Critical Issues: None Identified
No major bugs, security vulnerabilities, or breaking changes were found. The code appears to be defensive and follows HDF5's error handling patterns.
Code Quality Issues: Medium Priority
- Inconsistent Function Signature: The write_dset function signature change from 6 to 7 parameters (adding separate dataset and memory datatypes) lacks documentation explaining the
rationale:
// Old: write_dset(loc_id, rank, dims, dset_name, tid, buf)
// New: write_dset(loc_id, rank, dims, dset_name, tid_dset, tid_mem, buf) - Missing Error Handling: In CMakeTests.cmake:1014, the complex VOL connector test generation logic lacks proper error handling for file operations and path manipulations.
- Code Duplication: The ADD_H5_TEST macro modifications introduce repeated logic for handling different VOL connectors that could be abstracted into helper functions.
- Missing Function Documentation: The new gent_tvms() function lacks documentation explaining its purpose (generating VAX F64 datatype test files).
Enhancement Opportunities: Low Priority
- Performance Optimization: The CMake test generation could be optimized by caching file system operations and reducing redundant path calculations.
- Maintainability Improvements:
- Extract the path separator logic into a dedicated CMake function
- Add inline comments explaining the VOL connector test matrix approach
- Consider using CMake generator expressions for cleaner conditional logic - Test Coverage: The PR focuses on h5dump VOL testing but doesn't include corresponding tests for error conditions or edge cases specific to different VOL connectors.
- Configuration Management: The test configuration could benefit from a centralized VOL connector configuration file rather than inline conditional logic.
Specific Technical Recommendations:
- Line CMakeTests.cmake:1014: Consider extracting the complex path manipulation into a helper function:
function(normalize_path_separators input_path output_var)
# Implementation here
endfunction() - File h5dumpgentest.c: Add documentation for gent_tvms():
/*
- Function: gent_tvms
- Purpose: Generate test file with VAX F64 datatype for VOL connector testing
- Return: Success: 0, Failure: -1
*/
- File CMakeTests.cmake: Add error checking for file operations:
if(NOT EXISTS "${source_file}")
message(FATAL_ERROR "Required test file ${source_file} not found")
endif()
For example, Recommendaton 1
15bd0b1
1d111ce
to
15bd0b1
Compare
#define FILE95 "tcomplex.h5" | ||
#define FILE96 "tcomplex_be.h5" | ||
#endif | ||
#define FILE97 "tbfloat16.h5" |
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.
While it can be annoying to resolve git conflicts around, we should either keep the original naming/numbering scheme here, or convert the existing macros to new names, along with all the associated function-specific value macros. Otherwise, it's easier for the file name and other macros to go out of sync.
e131ee6
to
08384ab
Compare
Depends on #5761 and #5752. Will be marked ready for review once those are merged
Important
Add VOL tests for h5dump, update test generation logic, and modify test configurations.
h5dump
inCMakeTests.cmake
andCMakeTestsXML.cmake
.ADD_H5_TEST
macro to support VOL-specific tests and filtering.gent_tvms()
function inh5dumpgentest.c
andh5dumpgentest.h
for generating test files..github/workflows/vol_rest.yml
to excludeH5DUMP
from certain tests.NATIVE_ONLY
flag toADD_H5_TEST
macro for native VOL connector tests.write_dset()
inh5dumpgentest.c
to accepttid_memory
parameter for memory datatype.gent_fcontents()
andgent_fvalues()
to use newwrite_dset()
signature.This description was created by
for 5dfa416. You can customize this summary. It will automatically update as commits are pushed.