cli-test-framework 0.3.6__tar.gz → 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {cli_test_framework-0.3.6/src/cli_test_framework.egg-info → cli_test_framework-0.3.7}/PKG-INFO +46 -2
  2. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/README.md +44 -0
  3. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/docs/user_manual.md +23 -0
  4. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/setup.py +1 -1
  5. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/__init__.py +1 -1
  6. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/commands/compare.py +1 -1
  7. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/h5_comparator.py +25 -20
  8. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7/src/cli_test_framework.egg-info}/PKG-INFO +46 -2
  9. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/CHANGELOG.md +0 -0
  10. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/MANIFEST.in +0 -0
  11. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/pyproject.toml +0 -0
  12. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/setup.cfg +0 -0
  13. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/cli.py +0 -0
  14. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/commands/__init__.py +0 -0
  15. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/__init__.py +0 -0
  16. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/assertions.py +0 -0
  17. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/base_runner.py +0 -0
  18. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/parallel_runner.py +0 -0
  19. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/process_worker.py +0 -0
  20. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/setup.py +0 -0
  21. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/core/test_case.py +0 -0
  22. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/__init__.py +0 -0
  23. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/base_comparator.py +0 -0
  24. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/binary_comparator.py +0 -0
  25. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/csv_comparator.py +0 -0
  26. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/factory.py +0 -0
  27. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/json_comparator.py +0 -0
  28. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/result.py +0 -0
  29. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/text_comparator.py +0 -0
  30. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/file_comparator/xml_comparator.py +0 -0
  31. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/runners/__init__.py +0 -0
  32. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/runners/json_runner.py +0 -0
  33. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/runners/parallel_json_runner.py +0 -0
  34. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/runners/yaml_runner.py +0 -0
  35. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/utils/__init__.py +0 -0
  36. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/utils/path_resolver.py +0 -0
  37. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework/utils/report_generator.py +0 -0
  38. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework.egg-info/SOURCES.txt +0 -0
  39. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework.egg-info/dependency_links.txt +0 -0
  40. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework.egg-info/entry_points.txt +0 -0
  41. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework.egg-info/requires.txt +0 -0
  42. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/src/cli_test_framework.egg-info/top_level.txt +0 -0
  43. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/__init__.py +0 -0
  44. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  45. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/__pycache__/test_parallel_runner.cpython-312-pytest-7.4.4.pyc +0 -0
  46. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/__pycache__/test_setup_module.cpython-312-pytest-7.4.4.pyc +0 -0
  47. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/fixtures/test_cases.json +0 -0
  48. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/fixtures/test_cases.yaml +0 -0
  49. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/fixtures/test_cases1.json +0 -0
  50. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/fixtures/test_with_setup.json +0 -0
  51. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/fixtures/test_with_setup.yaml +0 -0
  52. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/performance_test.py +0 -0
  53. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test1.py +0 -0
  54. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_comprehensive_space.py +0 -0
  55. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_filter_demo.py +0 -0
  56. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_parallel_runner.py +0 -0
  57. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_parallel_space.py +0 -0
  58. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_report.txt +0 -0
  59. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_runners.py +0 -0
  60. {cli_test_framework-0.3.6 → cli_test_framework-0.3.7}/tests/test_setup_module.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cli-test-framework
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: A powerful command line testing framework in Python with setup modules, parallel execution, and file comparison capabilities.
5
5
  Home-page: https://github.com/ozil111/cli-test-framework
6
6
  Author: Xiaotong Wang
@@ -233,6 +233,11 @@ compare-files data1.h5 data2.h5 \
233
233
  compare-files data1.h5 data2.h5 \
234
234
  --h5-table-regex "group1/.*" \
235
235
  --h5-structure-only
236
+
237
+ # Use comma-separated table names with regex (New in 0.3.7)
238
+ compare-files data1.h5 data2.h5 \
239
+ --h5-table-regex "table1,table2,table3" \
240
+ --h5-rtol 1e-6
236
241
  ```
237
242
 
238
243
  #### Binary Comparison
@@ -519,3 +524,42 @@ The user manual includes:
519
524
  **🚀 Ready to supercharge your testing workflow with setup modules, parallel execution and advanced file comparison!**
520
525
 
521
526
  For detailed parallel testing guide, see: [PARALLEL_TESTING_GUIDE.md](https://github.com/ozil111/cli-test-framework/blob/main/PARALLEL_TESTING_GUIDE.md)
527
+
528
+ # 支持数据过滤(New in 0.3.6)
529
+
530
+ 你可以通过 `--h5-data-filter` 选项只比较满足特定条件的数据。例如:
531
+
532
+ ```bash
533
+ # 只比较大于 1e-6 的数据
534
+ compare-files data1.h5 data2.h5 --h5-data-filter '>1e-6'
535
+
536
+ # 只比较绝对值大于 1e-6 的数据
537
+ compare-files data1.h5 data2.h5 --h5-data-filter 'abs>1e-6'
538
+
539
+ # 只比较小于等于 0.01 的数据
540
+ compare-files data1.h5 data2.h5 --h5-data-filter '<=0.01'
541
+ ```
542
+
543
+ 支持的表达式包括:`>`, `>=`, `<`, `<=`, `==`,以及 `abs` 前缀(绝对值过滤)。
544
+
545
+ # 版本更新日志
546
+
547
+ ## 0.3.7 (Latest)
548
+
549
+ ### 🐛 Bug Fixes
550
+ - **Fixed H5 table regex matching**: `--h5-table-regex=table1,table2` now correctly matches both `table1` and `table2` instead of treating the entire string as a single regex pattern
551
+ - **Enhanced regex pattern support**: Multiple comma-separated table names are now supported in `--h5-table-regex` parameter
552
+
553
+ ### ✨ New Features
554
+ - **Improved HDF5 comparison**: Better handling of multiple table selection with regex patterns
555
+ - **Enhanced debug output**: More detailed logging for HDF5 table matching process
556
+
557
+ ### 🔧 Improvements
558
+ - **Backward compatibility**: All existing functionality remains unchanged
559
+ - **Better error handling**: More informative error messages for regex pattern parsing
560
+
561
+ ## 0.3.6
562
+
563
+ ### ✨ New Features
564
+ - **Data filtering for HDF5 files**: Added `--h5-data-filter` option to compare only data meeting specific criteria
565
+ - **Enhanced HDF5 comparison**: Support for absolute value filtering and various comparison operators
@@ -198,6 +198,11 @@ compare-files data1.h5 data2.h5 \
198
198
  compare-files data1.h5 data2.h5 \
199
199
  --h5-table-regex "group1/.*" \
200
200
  --h5-structure-only
201
+
202
+ # Use comma-separated table names with regex (New in 0.3.7)
203
+ compare-files data1.h5 data2.h5 \
204
+ --h5-table-regex "table1,table2,table3" \
205
+ --h5-rtol 1e-6
201
206
  ```
202
207
 
203
208
  #### Binary Comparison
@@ -484,3 +489,42 @@ The user manual includes:
484
489
  **🚀 Ready to supercharge your testing workflow with setup modules, parallel execution and advanced file comparison!**
485
490
 
486
491
  For detailed parallel testing guide, see: [PARALLEL_TESTING_GUIDE.md](https://github.com/ozil111/cli-test-framework/blob/main/PARALLEL_TESTING_GUIDE.md)
492
+
493
+ # 支持数据过滤(New in 0.3.6)
494
+
495
+ 你可以通过 `--h5-data-filter` 选项只比较满足特定条件的数据。例如:
496
+
497
+ ```bash
498
+ # 只比较大于 1e-6 的数据
499
+ compare-files data1.h5 data2.h5 --h5-data-filter '>1e-6'
500
+
501
+ # 只比较绝对值大于 1e-6 的数据
502
+ compare-files data1.h5 data2.h5 --h5-data-filter 'abs>1e-6'
503
+
504
+ # 只比较小于等于 0.01 的数据
505
+ compare-files data1.h5 data2.h5 --h5-data-filter '<=0.01'
506
+ ```
507
+
508
+ 支持的表达式包括:`>`, `>=`, `<`, `<=`, `==`,以及 `abs` 前缀(绝对值过滤)。
509
+
510
+ # 版本更新日志
511
+
512
+ ## 0.3.7 (Latest)
513
+
514
+ ### 🐛 Bug Fixes
515
+ - **Fixed H5 table regex matching**: `--h5-table-regex=table1,table2` now correctly matches both `table1` and `table2` instead of treating the entire string as a single regex pattern
516
+ - **Enhanced regex pattern support**: Multiple comma-separated table names are now supported in `--h5-table-regex` parameter
517
+
518
+ ### ✨ New Features
519
+ - **Improved HDF5 comparison**: Better handling of multiple table selection with regex patterns
520
+ - **Enhanced debug output**: More detailed logging for HDF5 table matching process
521
+
522
+ ### 🔧 Improvements
523
+ - **Backward compatibility**: All existing functionality remains unchanged
524
+ - **Better error handling**: More informative error messages for regex pattern parsing
525
+
526
+ ## 0.3.6
527
+
528
+ ### ✨ New Features
529
+ - **Data filtering for HDF5 files**: Added `--h5-data-filter` option to compare only data meeting specific criteria
530
+ - **Enhanced HDF5 comparison**: Support for absolute value filtering and various comparison operators
@@ -319,8 +319,31 @@ compare-files data1.h5 data2.h5 --h5-table table1,table2
319
319
 
320
320
  # Compare with numerical tolerance
321
321
  compare-files data1.h5 data2.h5 --h5-rtol 1e-5 --h5-atol 1e-8
322
+
323
+ # Use regex patterns for table selection
324
+ compare-files data1.h5 data2.h5 --h5-table-regex "table.*"
325
+
326
+ # Use comma-separated table names with regex (New in 0.3.7)
327
+ compare-files data1.h5 data2.h5 --h5-table-regex "table1,table2,table3"
328
+ ```
329
+
330
+ #### Data Filtering (New in 0.3.7)
331
+
332
+ You can use the `--h5-data-filter` option to only compare data that meets a certain condition. For example:
333
+
334
+ ```bash
335
+ # Only compare values greater than 1e-6
336
+ compare-files data1.h5 data2.h5 --h5-data-filter '>1e-6'
337
+
338
+ # Only compare absolute values greater than 1e-6
339
+ compare-files data1.h5 data2.h5 --h5-data-filter 'abs>1e-6'
340
+
341
+ # Only compare values less than or equal to 0.01
342
+ compare-files data1.h5 data2.h5 --h5-data-filter '<=0.01'
322
343
  ```
323
344
 
345
+ Supported filter expressions: `>`, `>=`, `<`, `<=`, `==`, and `abs` prefix for absolute value filtering.
346
+
324
347
  ### Binary File Comparison
325
348
  ```bash
326
349
  # Compare with similarity check
@@ -8,7 +8,7 @@ with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
8
8
 
9
9
  setup(
10
10
  name="cli-test-framework",
11
- version="0.3.6",
11
+ version="0.3.7",
12
12
  author="Xiaotong Wang",
13
13
  author_email="xiaotongwang98@gmail.com",
14
14
  description="A powerful command line testing framework in Python with setup modules, parallel execution, and file comparison capabilities.",
@@ -5,7 +5,7 @@ This package provides tools for testing command-line applications and scripts
5
5
  with support for parallel execution and advanced file comparison capabilities.
6
6
  """
7
7
 
8
- __version__ = "0.3.3"
8
+ __version__ = "0.3.7"
9
9
  __author__ = "Xiaotong Wang"
10
10
  __email__ = "xiaotongwang98@gmail.com"
11
11
 
@@ -58,7 +58,7 @@ def parse_arguments():
58
58
  # H5 comparison options
59
59
  h5_group = parser.add_argument_group('HDF5 comparison options')
60
60
  h5_group.add_argument("--h5-table", help="Comma-separated list of table names to compare in HDF5 files")
61
- h5_group.add_argument("--h5-table-regex", help="Regular expression pattern to match table names in HDF5 files")
61
+ h5_group.add_argument("--h5-table-regex", help="Comma-separated list of regular expression patterns to match table names in HDF5 files. Each pattern is matched independently.")
62
62
  h5_group.add_argument("--h5-structure-only", action="store_true",
63
63
  help="Only compare HDF5 file structure without comparing content")
64
64
  h5_group.add_argument("--h5-show-content-diff", action="store_true",
@@ -123,31 +123,36 @@ class H5Comparator(BaseComparator):
123
123
 
124
124
  if self.tables or self.table_regex:
125
125
  # If specific tables or regex pattern is specified
126
+ regex_patterns = []
126
127
  if self.table_regex:
127
- # If the regex looks like a simple path (no regex metacharacters except . and /),
128
- # escape it to treat it as a literal string
129
- regex_str = self.table_regex
130
- self.logger.debug(f"Original table_regex: {regex_str}")
131
- # Check if it contains regex metacharacters other than . and /
132
- import string
133
- regex_metacharacters = set('[]{}()*+?^$|\\')
134
- if not any(char in regex_str for char in regex_metacharacters):
135
- # Escape dots and other special characters for literal matching
136
- regex_str = re.escape(regex_str)
137
- self.logger.debug(f"Treating table_regex as literal path, escaped: {regex_str}")
138
- else:
139
- self.logger.debug(f"Using table_regex as regular expression: {regex_str}")
140
- regex_pattern = re.compile(regex_str)
141
- else:
142
- regex_pattern = None
128
+ # Split by comma to support multiple regex patterns
129
+ regex_strings = [pattern.strip() for pattern in self.table_regex.split(',')]
130
+ self.logger.debug(f"Parsed regex patterns: {regex_strings}")
131
+
132
+ for regex_str in regex_strings:
133
+ # If the regex looks like a simple path (no regex metacharacters except . and /),
134
+ # escape it to treat it as a literal string
135
+ self.logger.debug(f"Processing regex pattern: {regex_str}")
136
+ # Check if it contains regex metacharacters other than . and /
137
+ import string
138
+ regex_metacharacters = set('[]{}()*+?^$|\\')
139
+ if not any(char in regex_str for char in regex_metacharacters):
140
+ # Escape dots and other special characters for literal matching
141
+ escaped_regex_str = re.escape(regex_str)
142
+ self.logger.debug(f"Treating pattern as literal path, escaped: {escaped_regex_str}")
143
+ regex_patterns.append(re.compile(escaped_regex_str))
144
+ else:
145
+ self.logger.debug(f"Using pattern as regular expression: {regex_str}")
146
+ regex_patterns.append(re.compile(regex_str))
143
147
 
144
148
  def should_process(name):
145
149
  if self.tables and name in self.tables:
146
150
  self.logger.debug(f"Matched by tables list: {name}")
147
151
  return True
148
- if regex_pattern and regex_pattern.fullmatch(name):
149
- self.logger.debug(f"Matched by regex: {name}")
150
- return True
152
+ for pattern in regex_patterns:
153
+ if pattern.fullmatch(name):
154
+ self.logger.debug(f"Matched by regex pattern {pattern.pattern}: {name}")
155
+ return True
151
156
  return False
152
157
 
153
158
  def process_item(name, item):
@@ -187,7 +192,7 @@ class H5Comparator(BaseComparator):
187
192
  self.logger.error(f"Error processing {table_path}: {str(e)}")
188
193
 
189
194
  # Then process regex pattern if specified
190
- if regex_pattern:
195
+ if regex_patterns:
191
196
  def visit_with_regex(name, obj):
192
197
  self.logger.debug(f"Checking path: {name}")
193
198
  if should_process(name):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cli-test-framework
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: A powerful command line testing framework in Python with setup modules, parallel execution, and file comparison capabilities.
5
5
  Home-page: https://github.com/ozil111/cli-test-framework
6
6
  Author: Xiaotong Wang
@@ -233,6 +233,11 @@ compare-files data1.h5 data2.h5 \
233
233
  compare-files data1.h5 data2.h5 \
234
234
  --h5-table-regex "group1/.*" \
235
235
  --h5-structure-only
236
+
237
+ # Use comma-separated table names with regex (New in 0.3.7)
238
+ compare-files data1.h5 data2.h5 \
239
+ --h5-table-regex "table1,table2,table3" \
240
+ --h5-rtol 1e-6
236
241
  ```
237
242
 
238
243
  #### Binary Comparison
@@ -519,3 +524,42 @@ The user manual includes:
519
524
  **🚀 Ready to supercharge your testing workflow with setup modules, parallel execution and advanced file comparison!**
520
525
 
521
526
  For detailed parallel testing guide, see: [PARALLEL_TESTING_GUIDE.md](https://github.com/ozil111/cli-test-framework/blob/main/PARALLEL_TESTING_GUIDE.md)
527
+
528
+ # 支持数据过滤(New in 0.3.6)
529
+
530
+ 你可以通过 `--h5-data-filter` 选项只比较满足特定条件的数据。例如:
531
+
532
+ ```bash
533
+ # 只比较大于 1e-6 的数据
534
+ compare-files data1.h5 data2.h5 --h5-data-filter '>1e-6'
535
+
536
+ # 只比较绝对值大于 1e-6 的数据
537
+ compare-files data1.h5 data2.h5 --h5-data-filter 'abs>1e-6'
538
+
539
+ # 只比较小于等于 0.01 的数据
540
+ compare-files data1.h5 data2.h5 --h5-data-filter '<=0.01'
541
+ ```
542
+
543
+ 支持的表达式包括:`>`, `>=`, `<`, `<=`, `==`,以及 `abs` 前缀(绝对值过滤)。
544
+
545
+ # 版本更新日志
546
+
547
+ ## 0.3.7 (Latest)
548
+
549
+ ### 🐛 Bug Fixes
550
+ - **Fixed H5 table regex matching**: `--h5-table-regex=table1,table2` now correctly matches both `table1` and `table2` instead of treating the entire string as a single regex pattern
551
+ - **Enhanced regex pattern support**: Multiple comma-separated table names are now supported in `--h5-table-regex` parameter
552
+
553
+ ### ✨ New Features
554
+ - **Improved HDF5 comparison**: Better handling of multiple table selection with regex patterns
555
+ - **Enhanced debug output**: More detailed logging for HDF5 table matching process
556
+
557
+ ### 🔧 Improvements
558
+ - **Backward compatibility**: All existing functionality remains unchanged
559
+ - **Better error handling**: More informative error messages for regex pattern parsing
560
+
561
+ ## 0.3.6
562
+
563
+ ### ✨ New Features
564
+ - **Data filtering for HDF5 files**: Added `--h5-data-filter` option to compare only data meeting specific criteria
565
+ - **Enhanced HDF5 comparison**: Support for absolute value filtering and various comparison operators