cli-test-framework 0.1.0__tar.gz → 0.2.0__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.
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/PKG-INFO +8 -2
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/README.md +56 -64
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/setup.py +13 -3
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/PKG-INFO +8 -2
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/SOURCES.txt +2 -0
- cli_test_framework-0.2.0/src/cli_test_framework.egg-info/entry_points.txt +3 -0
- cli_test_framework-0.2.0/src/cli_test_framework.egg-info/requires.txt +5 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/pyproject.toml +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/setup.cfg +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/dependency_links.txt +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/top_level.txt +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/__init__.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/assertions.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/base_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/parallel_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/process_worker.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/core/test_case.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/runners/__init__.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/runners/json_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/runners/parallel_json_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/runners/yaml_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/utils/__init__.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/utils/path_resolver.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/utils/report_generator.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/tests/test1.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/tests/test_comprehensive_space.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/tests/test_parallel_runner.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/tests/test_parallel_space.py +0 -0
- {cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/tests/test_runners.py +0 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cli-test-framework
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A small command line testing framework in Python.
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A small command line testing framework in Python with file comparison capabilities.
|
|
5
5
|
Author: Xiaotong Wang
|
|
6
6
|
Author-email: xiaotongwang98@gmail.com
|
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Requires-Python: >=3.6
|
|
11
|
+
Requires-Dist: dukpy==0.5.0
|
|
12
|
+
Requires-Dist: h5py>=3.8.0
|
|
13
|
+
Requires-Dist: numpy>=2.0.1
|
|
14
|
+
Requires-Dist: setuptools>=75.8.0
|
|
15
|
+
Requires-Dist: wheel>=0.45.1
|
|
11
16
|
Dynamic: author
|
|
12
17
|
Dynamic: author-email
|
|
13
18
|
Dynamic: classifier
|
|
19
|
+
Dynamic: requires-dist
|
|
14
20
|
Dynamic: requires-python
|
|
15
21
|
Dynamic: summary
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 1. Overview
|
|
4
4
|
|
|
5
|
-
This is a lightweight and extensible automated testing framework that supports defining test cases via JSON/YAML formats, providing complete test execution, result verification, and report generation capabilities. The framework is designed to provide standardized test management for command-line tools and scripts, with enterprise-grade parallel execution support.
|
|
5
|
+
This is a lightweight and extensible automated testing framework that supports defining test cases via JSON/YAML formats, providing complete test execution, result verification, and report generation capabilities. The framework is designed to provide standardized test management for command-line tools and scripts, with enterprise-grade parallel execution support and advanced file comparison features.
|
|
6
6
|
|
|
7
7
|
## 2. Features
|
|
8
8
|
|
|
@@ -16,13 +16,14 @@ This is a lightweight and extensible automated testing framework that supports d
|
|
|
16
16
|
- **🔒 Isolated Execution Environment**: Independent sub-process execution ensures test isolation
|
|
17
17
|
- **📊 Comprehensive Reports**: Detailed pass rate statistics and failure diagnostics
|
|
18
18
|
- **🔧 Thread-Safe Design**: Robust concurrent execution with proper synchronization
|
|
19
|
+
- **📝 Advanced File Comparison**: Support for comparing various file types (text, binary, JSON, HDF5) with detailed diff output
|
|
19
20
|
|
|
20
21
|
## 3. Quick Start
|
|
21
22
|
|
|
22
23
|
### Environment Requirements
|
|
23
24
|
|
|
24
25
|
```bash
|
|
25
|
-
pip install -
|
|
26
|
+
pip install cli-test-framework
|
|
26
27
|
Python >= 3.6
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -38,7 +39,7 @@ runner = JSONRunner(
|
|
|
38
39
|
success = runner.run_tests()
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
### Parallel Execution
|
|
42
|
+
### Parallel Execution
|
|
42
43
|
|
|
43
44
|
```python
|
|
44
45
|
from src.runners.parallel_json_runner import ParallelJSONRunner
|
|
@@ -51,21 +52,22 @@ runner = ParallelJSONRunner(
|
|
|
51
52
|
execution_mode="thread" # "thread" or "process"
|
|
52
53
|
)
|
|
53
54
|
success = runner.run_tests()
|
|
54
|
-
|
|
55
|
-
# Performance comparison example
|
|
56
|
-
python parallel_example.py
|
|
57
55
|
```
|
|
58
56
|
|
|
59
|
-
###
|
|
57
|
+
### File Comparison
|
|
60
58
|
|
|
61
|
-
```
|
|
62
|
-
|
|
59
|
+
```bash
|
|
60
|
+
# Compare two text files
|
|
61
|
+
compare-files file1.txt file2.txt
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
# Compare JSON files with key-based comparison
|
|
64
|
+
compare-files data1.json data2.json --json-compare-mode key-based --json-key-field id
|
|
65
|
+
|
|
66
|
+
# Compare HDF5 files with specific options
|
|
67
|
+
compare-files data1.h5 data2.h5 --h5-table table1,table2 --h5-rtol 1e-6
|
|
68
|
+
|
|
69
|
+
# Compare binary files with similarity check
|
|
70
|
+
compare-files binary1.bin binary2.bin --similarity
|
|
69
71
|
```
|
|
70
72
|
|
|
71
73
|
## 4. Test Case Format
|
|
@@ -77,7 +79,7 @@ success = runner.run_tests()
|
|
|
77
79
|
"test_cases": [
|
|
78
80
|
{
|
|
79
81
|
"name": "File Comparison Test",
|
|
80
|
-
"command": "
|
|
82
|
+
"command": "compare-files",
|
|
81
83
|
"args": ["file1.txt", "file2.txt", "--verbose"],
|
|
82
84
|
"expected": {
|
|
83
85
|
"return_code": 0,
|
|
@@ -103,67 +105,53 @@ test_cases:
|
|
|
103
105
|
output_matches: ".*\\.md$"
|
|
104
106
|
```
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
The framework intelligently handles various command formats:
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
"command": "echo", // Simple command
|
|
113
|
-
"command": "python script.py", // Command with script
|
|
114
|
-
"command": "node ./app.js --port", // Complex command with flags
|
|
115
|
-
}
|
|
116
|
-
```
|
|
108
|
+
## 5. File Comparison Features
|
|
117
109
|
|
|
118
|
-
|
|
110
|
+
### Supported File Types
|
|
119
111
|
|
|
120
|
-
|
|
112
|
+
- **Text Files**: Plain text, source code, markdown, etc.
|
|
113
|
+
- **JSON Files**: With exact or key-based comparison
|
|
114
|
+
- **HDF5 Files**: Structure and content comparison with numerical tolerance
|
|
115
|
+
- **Binary Files**: With optional similarity index calculation
|
|
121
116
|
|
|
122
|
-
|
|
117
|
+
### Comparison Options
|
|
123
118
|
|
|
119
|
+
#### Text Comparison
|
|
124
120
|
```bash
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
# Sequential execution: 12.45 seconds
|
|
130
|
-
# Parallel execution (thread): 3.21 seconds (3.88x speedup)
|
|
131
|
-
# Parallel execution (process): 4.12 seconds (3.02x speedup)
|
|
121
|
+
compare-files file1.txt file2.txt \
|
|
122
|
+
--start-line 10 \
|
|
123
|
+
--end-line 20 \
|
|
124
|
+
--encoding utf-8
|
|
132
125
|
```
|
|
133
126
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
- **Recommended workers**: CPU cores × 2-4
|
|
140
|
-
|
|
141
|
-
```python
|
|
142
|
-
runner = ParallelJSONRunner(
|
|
143
|
-
config_file="test_cases.json",
|
|
144
|
-
max_workers=4,
|
|
145
|
-
execution_mode="thread"
|
|
146
|
-
)
|
|
127
|
+
#### JSON Comparison
|
|
128
|
+
```bash
|
|
129
|
+
compare-files data1.json data2.json \
|
|
130
|
+
--json-compare-mode key-based \
|
|
131
|
+
--json-key-field id,name
|
|
147
132
|
```
|
|
148
133
|
|
|
149
|
-
####
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
134
|
+
#### HDF5 Comparison
|
|
135
|
+
```bash
|
|
136
|
+
compare-files data1.h5 data2.h5 \
|
|
137
|
+
--h5-table table1,table2 \
|
|
138
|
+
--h5-structure-only \
|
|
139
|
+
--h5-rtol 1e-5 \
|
|
140
|
+
--h5-atol 1e-8
|
|
141
|
+
```
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
)
|
|
143
|
+
#### Binary Comparison
|
|
144
|
+
```bash
|
|
145
|
+
compare-files binary1.bin binary2.bin \
|
|
146
|
+
--similarity \
|
|
147
|
+
--chunk-size 16384
|
|
160
148
|
```
|
|
161
149
|
|
|
162
|
-
###
|
|
150
|
+
### Output Formats
|
|
163
151
|
|
|
164
|
-
- **
|
|
165
|
-
- **
|
|
166
|
-
- **
|
|
152
|
+
- **Text**: Human-readable diff output
|
|
153
|
+
- **JSON**: Structured comparison results
|
|
154
|
+
- **HTML**: Visual diff with syntax highlighting
|
|
167
155
|
|
|
168
156
|
## 6. System Architecture
|
|
169
157
|
|
|
@@ -182,6 +170,10 @@ graph TD
|
|
|
182
170
|
H --> I[Assertion Engine]
|
|
183
171
|
I --> J[Thread-Safe Result Collection]
|
|
184
172
|
J --> K[Report Generator]
|
|
173
|
+
L[File Comparator] --> M[Text Comparator]
|
|
174
|
+
L --> N[JSON Comparator]
|
|
175
|
+
L --> O[HDF5 Comparator]
|
|
176
|
+
L --> P[Binary Comparator]
|
|
185
177
|
```
|
|
186
178
|
|
|
187
179
|
### Core Components
|
|
@@ -413,6 +405,6 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
|
413
405
|
|
|
414
406
|
---
|
|
415
407
|
|
|
416
|
-
**🚀 Ready to supercharge your testing workflow with parallel execution!**
|
|
408
|
+
**🚀 Ready to supercharge your testing workflow with parallel execution and advanced file comparison!**
|
|
417
409
|
|
|
418
410
|
For detailed parallel testing guide, see: [PARALLEL_TESTING_GUIDE.md](PARALLEL_TESTING_GUIDE.md)
|
|
@@ -2,15 +2,25 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="cli-test-framework",
|
|
5
|
-
version="0.
|
|
5
|
+
version="0.2.0",
|
|
6
6
|
author="Xiaotong Wang",
|
|
7
7
|
author_email="xiaotongwang98@gmail.com",
|
|
8
|
-
description="A small command line testing framework in Python.",
|
|
8
|
+
description="A small command line testing framework in Python with file comparison capabilities.",
|
|
9
9
|
packages=find_packages(where="src"),
|
|
10
10
|
package_dir={"": "src"},
|
|
11
11
|
install_requires=[
|
|
12
|
-
|
|
12
|
+
"dukpy==0.5.0",
|
|
13
|
+
"h5py>=3.8.0",
|
|
14
|
+
"numpy>=2.0.1",
|
|
15
|
+
"setuptools>=75.8.0",
|
|
16
|
+
"wheel>=0.45.1"
|
|
13
17
|
],
|
|
18
|
+
entry_points={
|
|
19
|
+
'console_scripts': [
|
|
20
|
+
'cli-test=cli_test_framework.cli:main',
|
|
21
|
+
'compare-files=cli_test_framework.commands.compare:main',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
14
24
|
classifiers=[
|
|
15
25
|
"Programming Language :: Python :: 3",
|
|
16
26
|
"License :: OSI Approved :: MIT License",
|
{cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/PKG-INFO
RENAMED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cli-test-framework
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A small command line testing framework in Python.
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A small command line testing framework in Python with file comparison capabilities.
|
|
5
5
|
Author: Xiaotong Wang
|
|
6
6
|
Author-email: xiaotongwang98@gmail.com
|
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Requires-Python: >=3.6
|
|
11
|
+
Requires-Dist: dukpy==0.5.0
|
|
12
|
+
Requires-Dist: h5py>=3.8.0
|
|
13
|
+
Requires-Dist: numpy>=2.0.1
|
|
14
|
+
Requires-Dist: setuptools>=75.8.0
|
|
15
|
+
Requires-Dist: wheel>=0.45.1
|
|
11
16
|
Dynamic: author
|
|
12
17
|
Dynamic: author-email
|
|
13
18
|
Dynamic: classifier
|
|
19
|
+
Dynamic: requires-dist
|
|
14
20
|
Dynamic: requires-python
|
|
15
21
|
Dynamic: summary
|
{cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/SOURCES.txt
RENAMED
|
@@ -4,6 +4,8 @@ setup.py
|
|
|
4
4
|
src/cli_test_framework.egg-info/PKG-INFO
|
|
5
5
|
src/cli_test_framework.egg-info/SOURCES.txt
|
|
6
6
|
src/cli_test_framework.egg-info/dependency_links.txt
|
|
7
|
+
src/cli_test_framework.egg-info/entry_points.txt
|
|
8
|
+
src/cli_test_framework.egg-info/requires.txt
|
|
7
9
|
src/cli_test_framework.egg-info/top_level.txt
|
|
8
10
|
src/core/__init__.py
|
|
9
11
|
src/core/assertions.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_test_framework-0.1.0 → cli_test_framework-0.2.0}/src/cli_test_framework.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|