pintest-cli 0.3.4__tar.gz → 0.3.6__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.
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/PKG-INFO +1 -1
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/build_mapping_iterative.py +14 -5
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/cli.py +12 -10
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/PKG-INFO +1 -1
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/setup.py +1 -1
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/README.md +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/__init__.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/cloud_mapping_db.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/config.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/coverage_mapper.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/git_diff_parser.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/post_commit_hook.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/pre_commit_hook.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/push_cache.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/pytest_plugin.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/range_set.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/test_mapping_db_v2.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest/update_mapping.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/SOURCES.txt +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/dependency_links.txt +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/entry_points.txt +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/requires.txt +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/pintest_cli.egg-info/top_level.txt +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/setup.cfg +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/tests/__init__.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/tests/test_cli_e2e.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/tests/test_git_diff_parser.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/tests/test_new_feature.py +0 -0
- {pintest_cli-0.3.4 → pintest_cli-0.3.6}/tests/test_range_set.py +0 -0
|
@@ -35,7 +35,8 @@ def run_test_chunk_with_mapping(
|
|
|
35
35
|
repo_root: Path,
|
|
36
36
|
test_names: list,
|
|
37
37
|
mapping_db_path: Path,
|
|
38
|
-
verbose: bool = False
|
|
38
|
+
verbose: bool = False,
|
|
39
|
+
pytest_args: list = None
|
|
39
40
|
) -> tuple[Set[str], Set[str]]:
|
|
40
41
|
"""
|
|
41
42
|
Run a chunk of tests with coverage and update mapping.
|
|
@@ -45,6 +46,7 @@ def run_test_chunk_with_mapping(
|
|
|
45
46
|
test_names: List of test names to run
|
|
46
47
|
mapping_db_path: Path to mapping database
|
|
47
48
|
verbose: Print verbose output
|
|
49
|
+
pytest_args: Additional pytest arguments
|
|
48
50
|
|
|
49
51
|
Returns:
|
|
50
52
|
Tuple of (passed_tests, failed_tests)
|
|
@@ -59,7 +61,10 @@ def run_test_chunk_with_mapping(
|
|
|
59
61
|
"--cov-report=",
|
|
60
62
|
"-v",
|
|
61
63
|
"--tb=short",
|
|
62
|
-
]
|
|
64
|
+
]
|
|
65
|
+
if pytest_args:
|
|
66
|
+
cmd.extend(pytest_args)
|
|
67
|
+
cmd.extend(test_names)
|
|
63
68
|
|
|
64
69
|
print(f" Running: {' '.join(cmd[:6])} ... {len(test_names)} tests", flush=True)
|
|
65
70
|
|
|
@@ -152,7 +157,8 @@ def build_mapping_iteratively(
|
|
|
152
157
|
repo_root: Path,
|
|
153
158
|
mapping_db: Path,
|
|
154
159
|
test_dir: str = "unit_tests",
|
|
155
|
-
verbose: bool = False
|
|
160
|
+
verbose: bool = False,
|
|
161
|
+
pytest_args: list = None
|
|
156
162
|
):
|
|
157
163
|
"""
|
|
158
164
|
Build mapping database by running unmapped tests.
|
|
@@ -164,6 +170,7 @@ def build_mapping_iteratively(
|
|
|
164
170
|
mapping_db: Path to mapping database
|
|
165
171
|
test_dir: Test directory to collect from (default: "unit_tests")
|
|
166
172
|
verbose: Print verbose output
|
|
173
|
+
pytest_args: Additional pytest arguments
|
|
167
174
|
"""
|
|
168
175
|
repo_root = repo_root.resolve()
|
|
169
176
|
|
|
@@ -223,7 +230,8 @@ def build_mapping_iteratively(
|
|
|
223
230
|
repo_root,
|
|
224
231
|
chunk,
|
|
225
232
|
mapping_db,
|
|
226
|
-
verbose
|
|
233
|
+
verbose,
|
|
234
|
+
pytest_args
|
|
227
235
|
)
|
|
228
236
|
|
|
229
237
|
# Track for final statistics
|
|
@@ -244,7 +252,8 @@ def build_mapping_iteratively(
|
|
|
244
252
|
repo_root,
|
|
245
253
|
remaining_list,
|
|
246
254
|
mapping_db,
|
|
247
|
-
verbose
|
|
255
|
+
verbose,
|
|
256
|
+
pytest_args
|
|
248
257
|
)
|
|
249
258
|
|
|
250
259
|
# Track for final statistics
|
|
@@ -288,8 +288,8 @@ def cmd_run(args):
|
|
|
288
288
|
print("Exiting with error (run full test suite instead)", file=sys.stderr)
|
|
289
289
|
sys.exit(1)
|
|
290
290
|
|
|
291
|
-
# Remove '--' separator if present in
|
|
292
|
-
pytest_extra_args = args
|
|
291
|
+
# Remove '--' separator if present in unknown_args
|
|
292
|
+
pytest_extra_args = getattr(args, 'unknown_args', [])
|
|
293
293
|
if pytest_extra_args and pytest_extra_args[0] == '--':
|
|
294
294
|
pytest_extra_args = pytest_extra_args[1:]
|
|
295
295
|
|
|
@@ -361,11 +361,16 @@ def cmd_build_mapping(args):
|
|
|
361
361
|
# Use args.test_dir if explicitly provided and not the default "tests", otherwise use config
|
|
362
362
|
final_test_dir = args.test_dir if args.test_dir != "tests" else default_test_dir
|
|
363
363
|
|
|
364
|
+
pytest_args = getattr(args, 'unknown_args', [])
|
|
365
|
+
if pytest_args and pytest_args[0] == '--':
|
|
366
|
+
pytest_args = pytest_args[1:]
|
|
367
|
+
|
|
364
368
|
sys.exit(build_mapping_iteratively(
|
|
365
369
|
repo_root,
|
|
366
370
|
mapping_db,
|
|
367
371
|
test_dir=final_test_dir,
|
|
368
|
-
verbose=args.verbose
|
|
372
|
+
verbose=args.verbose,
|
|
373
|
+
pytest_args=pytest_args
|
|
369
374
|
))
|
|
370
375
|
|
|
371
376
|
|
|
@@ -649,11 +654,6 @@ Examples:
|
|
|
649
654
|
action="store_true",
|
|
650
655
|
help="Show detailed output"
|
|
651
656
|
)
|
|
652
|
-
run_parser.add_argument(
|
|
653
|
-
"pytest_args",
|
|
654
|
-
nargs=argparse.REMAINDER,
|
|
655
|
-
help="Additional arguments to pass to pytest (after --)"
|
|
656
|
-
)
|
|
657
657
|
run_parser.set_defaults(func=cmd_run)
|
|
658
658
|
|
|
659
659
|
# Update mapping command
|
|
@@ -782,13 +782,15 @@ Examples:
|
|
|
782
782
|
push_parser.set_defaults(func=cmd_push)
|
|
783
783
|
|
|
784
784
|
# Parse arguments
|
|
785
|
-
args = parser.
|
|
785
|
+
args, unknown = parser.parse_known_args()
|
|
786
786
|
|
|
787
787
|
# If no command specified, default to 'run'
|
|
788
788
|
if not args.command:
|
|
789
789
|
# Parse as 'run' command for backward compatibility
|
|
790
790
|
run_args = ['run'] + sys.argv[1:]
|
|
791
|
-
args = parser.
|
|
791
|
+
args, unknown = parser.parse_known_args(run_args)
|
|
792
|
+
|
|
793
|
+
args.unknown_args = unknown
|
|
792
794
|
|
|
793
795
|
# Execute command
|
|
794
796
|
if hasattr(args, 'func'):
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="pintest-cli",
|
|
8
|
-
version="0.3.
|
|
8
|
+
version="0.3.6",
|
|
9
9
|
description="Run only the tests affected by your code changes.",
|
|
10
10
|
long_description=long_description,
|
|
11
11
|
long_description_content_type="text/markdown",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|