robotframework-testselection 0.1.0__tar.gz → 0.3.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.
Files changed (47) hide show
  1. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/PKG-INFO +130 -4
  2. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/README.md +126 -1
  3. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/pyproject.toml +12 -1
  4. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/__init__.py +1 -1
  5. robotframework_testselection-0.3.0/src/TestSelection/cli.py +471 -0
  6. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/cache.py +25 -7
  7. robotframework_testselection-0.3.0/src/TestSelection/pipeline/vectorize_pytest.py +129 -0
  8. robotframework_testselection-0.3.0/src/TestSelection/pytest/__init__.py +1 -0
  9. robotframework_testselection-0.3.0/src/TestSelection/pytest/collector.py +120 -0
  10. robotframework_testselection-0.3.0/src/TestSelection/pytest/plugin.py +238 -0
  11. robotframework_testselection-0.3.0/src/TestSelection/pytest/runner.py +118 -0
  12. robotframework_testselection-0.3.0/src/TestSelection/pytest/text_builder.py +220 -0
  13. robotframework_testselection-0.3.0/src/TestSelection/selection/dpp.py +59 -0
  14. robotframework_testselection-0.1.0/src/TestSelection/cli.py +0 -256
  15. robotframework_testselection-0.1.0/src/TestSelection/selection/dpp.py +0 -31
  16. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/.gitignore +0 -0
  17. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/LICENSE +0 -0
  18. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/embedding/__init__.py +0 -0
  19. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/embedding/embedder.py +0 -0
  20. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/embedding/models.py +0 -0
  21. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/embedding/ports.py +0 -0
  22. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/execution/__init__.py +0 -0
  23. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/execution/listener.py +0 -0
  24. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/execution/prerun_modifier.py +0 -0
  25. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/execution/runner.py +0 -0
  26. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/parsing/__init__.py +0 -0
  27. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/parsing/datadriver_reader.py +0 -0
  28. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/parsing/keyword_resolver.py +0 -0
  29. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/parsing/suite_collector.py +0 -0
  30. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/parsing/text_builder.py +0 -0
  31. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/__init__.py +0 -0
  32. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/artifacts.py +0 -0
  33. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/errors.py +0 -0
  34. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/execute.py +0 -0
  35. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/select.py +0 -0
  36. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/pipeline/vectorize.py +0 -0
  37. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/py.typed +0 -0
  38. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/__init__.py +0 -0
  39. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/facility.py +0 -0
  40. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/filtering.py +0 -0
  41. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/fps.py +0 -0
  42. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/kmedoids.py +0 -0
  43. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/registry.py +0 -0
  44. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/selection/strategy.py +0 -0
  45. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/shared/__init__.py +0 -0
  46. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/shared/config.py +0 -0
  47. {robotframework_testselection-0.1.0 → robotframework_testselection-0.3.0}/src/TestSelection/shared/types.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testselection
3
- Version: 0.1.0
4
- Summary: Vector-based diverse test case selection for Robot Framework
3
+ Version: 0.3.0
4
+ Summary: Vector-based diverse test case selection for Robot Framework and pytest
5
5
  Project-URL: Homepage, https://github.com/manykarim/robotframework-testselection
6
6
  Project-URL: Documentation, https://github.com/manykarim/robotframework-testselection#readme
7
7
  Project-URL: Repository, https://github.com/manykarim/robotframework-testselection
@@ -10,8 +10,9 @@ Project-URL: Changelog, https://github.com/manykarim/robotframework-testselectio
10
10
  Author: Many Kasiriha
11
11
  License: Apache-2.0
12
12
  License-File: LICENSE
13
- Keywords: diversity,embeddings,machine-learning,nlp,robotframework,test-selection,testing
13
+ Keywords: diversity,embeddings,machine-learning,nlp,pytest,robotframework,test-selection,testing
14
14
  Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Framework :: Pytest
15
16
  Classifier: Framework :: Robot Framework
16
17
  Classifier: Framework :: Robot Framework :: Library
17
18
  Classifier: Framework :: Robot Framework :: Tool
@@ -58,7 +59,7 @@ Description-Content-Type: text/markdown
58
59
 
59
60
  # robotframework-testselection
60
61
 
61
- Vector-based diverse test case selection for Robot Framework. Embeds test cases as semantic vectors and selects maximally diverse subsets to reduce test suite execution time while preserving coverage breadth.
62
+ Vector-based diverse test case selection for Robot Framework and pytest. Embeds test cases as semantic vectors and selects maximally diverse subsets to reduce test suite execution time while preserving coverage breadth.
62
63
 
63
64
  ## How It Works
64
65
 
@@ -101,6 +102,8 @@ uv sync --extra vectorize
101
102
  uv sync --extra all
102
103
  ```
103
104
 
105
+ The pytest plugin is included in the base install and activates when you pass `--diverse-k` to pytest.
106
+
104
107
  ### Dependency Groups
105
108
 
106
109
  | Group | Packages | Purpose |
@@ -158,6 +161,62 @@ testcase-select vectorize \
158
161
  --datadriver-csv tests/data/login.csv tests/data/search.csv
159
162
  ```
160
163
 
164
+ ### Passing Robot Framework Options
165
+
166
+ All arguments after `--` are forwarded directly to `robot`. This lets you combine diversity selection with any Robot Framework option — variables, tag filters, log levels, listeners, etc.
167
+
168
+ ```bash
169
+ # Pass variables and set log level
170
+ testcase-select run --suite tests/ --k 20 \
171
+ -- --variable ENV:staging --variable USER:admin --loglevel DEBUG
172
+
173
+ # Use Robot's own tag filtering on top of diversity selection
174
+ testcase-select execute --suite tests/ --selection sel.json \
175
+ -- --include smoke --exclude manual
176
+
177
+ # Add metadata and custom output name
178
+ testcase-select run --suite tests/ --k 30 \
179
+ -- --metadata Version:2.1 --name "Smoke Regression"
180
+
181
+ # Set variables file and debug log
182
+ testcase-select run --suite tests/ --k 50 \
183
+ -- --variablefile config/env_staging.py --debugfile debug.log
184
+ ```
185
+
186
+ This works with both `run` and `execute` subcommands, including during graceful fallback (when selection fails and all tests are run).
187
+
188
+ ### pytest Support
189
+
190
+ The diversity selection algorithm also works with pytest test suites, via a pytest plugin:
191
+
192
+ ```bash
193
+ # Select 20 most diverse tests
194
+ pytest --diverse-k=20 tests/
195
+
196
+ # With custom strategy and seed
197
+ pytest --diverse-k=30 --diverse-strategy=fps_multi --diverse-seed=123 tests/
198
+
199
+ # Filter by markers before selection
200
+ pytest --diverse-k=20 --diverse-include-markers slow integration tests/
201
+
202
+ # Group parametrized tests (select at group level)
203
+ pytest --diverse-k=20 --diverse-group-parametrize tests/
204
+ ```
205
+
206
+ Or via the `testcase-select` CLI:
207
+
208
+ ```bash
209
+ # Full pipeline with pytest
210
+ testcase-select run --framework pytest --suite tests/ --k 20 --strategy fps
211
+
212
+ # Stage-by-stage
213
+ testcase-select vectorize --framework pytest --suite tests/ --output ./artifacts/
214
+ testcase-select select --artifacts ./artifacts/ --k 20
215
+ testcase-select execute --framework pytest --suite tests/ --selection selected_tests.json
216
+ ```
217
+
218
+ The pytest plugin is installed automatically and activated by `--diverse-k`. It uses AST-based text representation with sentence embeddings for test diversity analysis.
219
+
161
220
  ### Direct Robot Framework Integration
162
221
 
163
222
  You can also use the components directly with `robot`:
@@ -323,6 +382,11 @@ src/TestSelection/
323
382
  prerun_modifier.py # DiversePreRunModifier (SuiteVisitor)
324
383
  listener.py # DiverseDataDriverListener (Listener v3)
325
384
  runner.py # ExecutionRunner
385
+ pytest/ # pytest integration
386
+ plugin.py # pytest plugin (pytest11 entry point)
387
+ collector.py # Programmatic test collection
388
+ text_builder.py # AST-based text representation
389
+ runner.py # pytest execution
326
390
  pipeline/ # Orchestration layer
327
391
  vectorize.py # Stage 1 orchestrator
328
392
  select.py # Stage 2 orchestrator
@@ -377,6 +441,68 @@ uv run pytest -m integration
377
441
  uv run pytest -m benchmark
378
442
  ```
379
443
 
444
+ ## Coverage Retention Analysis
445
+
446
+ Measured on [robotframework-doctestlibrary](https://github.com/manykarim/robotframework-doctestlibrary) (5,045 statements in the DocTest package). All strategies use `all-MiniLM-L6-v2` embeddings (384-dim), seed=42.
447
+
448
+ ### pytest (594 tests, 70.1% full coverage)
449
+
450
+ | Strategy | Selection | Tests | Coverage | Retention | Speedup |
451
+ |---|---|---|---|---|---|
452
+ | *(full suite)* | 100% | 594 | 70.1% | baseline | 1.0x |
453
+ | **fps** | **50%** | **297** | **65.9%** | **93.9%** | **3.4x** |
454
+ | dpp | 50% | 297 | 65.9% | 93.9% | 3.5x |
455
+ | kmedoids | 50% | 297 | 65.8% | 93.8% | 3.1x |
456
+ | fps_multi | 50% | 297 | 65.7% | 93.7% | 3.0x |
457
+ | facility | 50% | 297 | 64.9% | 92.6% | 2.9x |
458
+ | random | 50% | 297 | 64.2% | 91.5% | 2.3x |
459
+ | **facility** | **20%** | **119** | **58.6%** | **83.6%** | **7.5x** |
460
+ | kmedoids | 20% | 119 | 58.3% | 83.1% | 6.7x |
461
+ | fps | 20% | 119 | 56.1% | 80.0% | 6.7x |
462
+ | fps_multi | 20% | 119 | 53.8% | 76.8% | 8.0x |
463
+ | random | 20% | 119 | 53.2% | 75.8% | 5.4x |
464
+ | dpp | 20% | 119 | 47.6% | 67.8% | 6.0x |
465
+ | **fps_multi** | **10%** | **60** | **47.7%** | **67.9%** | **18.5x** |
466
+ | kmedoids | 10% | 60 | 46.9% | 66.9% | 14.9x |
467
+ | facility | 10% | 60 | 46.8% | 66.8% | 11.5x |
468
+ | random | 10% | 60 | 44.3% | 63.1% | 10.3x |
469
+ | dpp | 10% | 60 | 42.9% | 61.1% | 13.7x |
470
+ | fps | 10% | 60 | 40.6% | 57.9% | 21.4x |
471
+
472
+ ### Robot Framework (126 tests, 63.5% full coverage)
473
+
474
+ | Strategy | Selection | Tests | Coverage | Retention | Speedup |
475
+ |---|---|---|---|---|---|
476
+ | *(full suite)* | 100% | 126 | 63.5% | baseline | 1.0x |
477
+ | **fps_multi** | **50%** | **63** | **61.6%** | **97.0%** | **1.5x** |
478
+ | facility | 50% | 63 | 61.6% | 96.9% | 1.5x |
479
+ | fps | 50% | 63 | 61.2% | 96.4% | 1.6x |
480
+ | kmedoids | 50% | 63 | 60.5% | 95.3% | 1.5x |
481
+ | dpp | 50% | 63 | 58.5% | 92.0% | 1.7x |
482
+ | random | 50% | 63 | 57.2% | 90.1% | 2.3x |
483
+ | **facility** | **20%** | **26** | **51.8%** | **81.5%** | **4.4x** |
484
+ | kmedoids | 20% | 26 | 47.5% | 74.8% | 5.5x |
485
+ | random | 20% | 26 | 46.0% | 72.5% | 5.7x |
486
+ | fps | 20% | 26 | 45.3% | 71.4% | 3.1x |
487
+ | fps_multi | 20% | 26 | 45.3% | 71.4% | 2.9x |
488
+ | dpp | 20% | 26 | 43.9% | 69.0% | 4.6x |
489
+ | **kmedoids** | **10%** | **13** | **42.3%** | **66.6%** | **11.3x** |
490
+ | dpp | 10% | 13 | 40.9% | 64.3% | 10.7x |
491
+ | facility | 10% | 13 | 40.2% | 63.3% | 12.9x |
492
+ | random | 10% | 13 | 37.6% | 59.2% | 11.3x |
493
+ | fps_multi | 10% | 13 | 37.5% | 59.1% | 10.7x |
494
+ | fps | 10% | 13 | 33.2% | 52.3% | 8.3x |
495
+
496
+ ### Key Findings
497
+
498
+ - **50% selection retains 92-97% of coverage** across all strategies — the diversity algorithms select tests maximizing behavioral breadth, with minimal redundancy loss
499
+ - **Facility location excels at 20% selection** — 83.6% retention on pytest, 81.5% on Robot Framework, making it the best choice for aggressive smoke-test suites
500
+ - **kmedoids matches facility at 20%** on pytest (83.1% retention) and leads at 10% on Robot Framework (66.6%)
501
+ - **fps_multi leads at 10% pytest** (67.9% retention) where initial-point sensitivity matters most
502
+ - **DPP performs well at 50%** (93.9% retention, matching FPS) but drops at 20% due to FPS fallback for large k values
503
+ - **All diversity strategies outperform random** at 50% by 2-7 percentage points of retention
504
+ - At 50% robot selection, fps_multi achieves **97% retention** — meaning half the tests contribute almost no incremental coverage
505
+
380
506
  ## Performance
381
507
 
382
508
  Benchmarked on 384-dimensional normalized vectors:
@@ -1,6 +1,6 @@
1
1
  # robotframework-testselection
2
2
 
3
- Vector-based diverse test case selection for Robot Framework. Embeds test cases as semantic vectors and selects maximally diverse subsets to reduce test suite execution time while preserving coverage breadth.
3
+ Vector-based diverse test case selection for Robot Framework and pytest. Embeds test cases as semantic vectors and selects maximally diverse subsets to reduce test suite execution time while preserving coverage breadth.
4
4
 
5
5
  ## How It Works
6
6
 
@@ -43,6 +43,8 @@ uv sync --extra vectorize
43
43
  uv sync --extra all
44
44
  ```
45
45
 
46
+ The pytest plugin is included in the base install and activates when you pass `--diverse-k` to pytest.
47
+
46
48
  ### Dependency Groups
47
49
 
48
50
  | Group | Packages | Purpose |
@@ -100,6 +102,62 @@ testcase-select vectorize \
100
102
  --datadriver-csv tests/data/login.csv tests/data/search.csv
101
103
  ```
102
104
 
105
+ ### Passing Robot Framework Options
106
+
107
+ All arguments after `--` are forwarded directly to `robot`. This lets you combine diversity selection with any Robot Framework option — variables, tag filters, log levels, listeners, etc.
108
+
109
+ ```bash
110
+ # Pass variables and set log level
111
+ testcase-select run --suite tests/ --k 20 \
112
+ -- --variable ENV:staging --variable USER:admin --loglevel DEBUG
113
+
114
+ # Use Robot's own tag filtering on top of diversity selection
115
+ testcase-select execute --suite tests/ --selection sel.json \
116
+ -- --include smoke --exclude manual
117
+
118
+ # Add metadata and custom output name
119
+ testcase-select run --suite tests/ --k 30 \
120
+ -- --metadata Version:2.1 --name "Smoke Regression"
121
+
122
+ # Set variables file and debug log
123
+ testcase-select run --suite tests/ --k 50 \
124
+ -- --variablefile config/env_staging.py --debugfile debug.log
125
+ ```
126
+
127
+ This works with both `run` and `execute` subcommands, including during graceful fallback (when selection fails and all tests are run).
128
+
129
+ ### pytest Support
130
+
131
+ The diversity selection algorithm also works with pytest test suites, via a pytest plugin:
132
+
133
+ ```bash
134
+ # Select 20 most diverse tests
135
+ pytest --diverse-k=20 tests/
136
+
137
+ # With custom strategy and seed
138
+ pytest --diverse-k=30 --diverse-strategy=fps_multi --diverse-seed=123 tests/
139
+
140
+ # Filter by markers before selection
141
+ pytest --diverse-k=20 --diverse-include-markers slow integration tests/
142
+
143
+ # Group parametrized tests (select at group level)
144
+ pytest --diverse-k=20 --diverse-group-parametrize tests/
145
+ ```
146
+
147
+ Or via the `testcase-select` CLI:
148
+
149
+ ```bash
150
+ # Full pipeline with pytest
151
+ testcase-select run --framework pytest --suite tests/ --k 20 --strategy fps
152
+
153
+ # Stage-by-stage
154
+ testcase-select vectorize --framework pytest --suite tests/ --output ./artifacts/
155
+ testcase-select select --artifacts ./artifacts/ --k 20
156
+ testcase-select execute --framework pytest --suite tests/ --selection selected_tests.json
157
+ ```
158
+
159
+ The pytest plugin is installed automatically and activated by `--diverse-k`. It uses AST-based text representation with sentence embeddings for test diversity analysis.
160
+
103
161
  ### Direct Robot Framework Integration
104
162
 
105
163
  You can also use the components directly with `robot`:
@@ -265,6 +323,11 @@ src/TestSelection/
265
323
  prerun_modifier.py # DiversePreRunModifier (SuiteVisitor)
266
324
  listener.py # DiverseDataDriverListener (Listener v3)
267
325
  runner.py # ExecutionRunner
326
+ pytest/ # pytest integration
327
+ plugin.py # pytest plugin (pytest11 entry point)
328
+ collector.py # Programmatic test collection
329
+ text_builder.py # AST-based text representation
330
+ runner.py # pytest execution
268
331
  pipeline/ # Orchestration layer
269
332
  vectorize.py # Stage 1 orchestrator
270
333
  select.py # Stage 2 orchestrator
@@ -319,6 +382,68 @@ uv run pytest -m integration
319
382
  uv run pytest -m benchmark
320
383
  ```
321
384
 
385
+ ## Coverage Retention Analysis
386
+
387
+ Measured on [robotframework-doctestlibrary](https://github.com/manykarim/robotframework-doctestlibrary) (5,045 statements in the DocTest package). All strategies use `all-MiniLM-L6-v2` embeddings (384-dim), seed=42.
388
+
389
+ ### pytest (594 tests, 70.1% full coverage)
390
+
391
+ | Strategy | Selection | Tests | Coverage | Retention | Speedup |
392
+ |---|---|---|---|---|---|
393
+ | *(full suite)* | 100% | 594 | 70.1% | baseline | 1.0x |
394
+ | **fps** | **50%** | **297** | **65.9%** | **93.9%** | **3.4x** |
395
+ | dpp | 50% | 297 | 65.9% | 93.9% | 3.5x |
396
+ | kmedoids | 50% | 297 | 65.8% | 93.8% | 3.1x |
397
+ | fps_multi | 50% | 297 | 65.7% | 93.7% | 3.0x |
398
+ | facility | 50% | 297 | 64.9% | 92.6% | 2.9x |
399
+ | random | 50% | 297 | 64.2% | 91.5% | 2.3x |
400
+ | **facility** | **20%** | **119** | **58.6%** | **83.6%** | **7.5x** |
401
+ | kmedoids | 20% | 119 | 58.3% | 83.1% | 6.7x |
402
+ | fps | 20% | 119 | 56.1% | 80.0% | 6.7x |
403
+ | fps_multi | 20% | 119 | 53.8% | 76.8% | 8.0x |
404
+ | random | 20% | 119 | 53.2% | 75.8% | 5.4x |
405
+ | dpp | 20% | 119 | 47.6% | 67.8% | 6.0x |
406
+ | **fps_multi** | **10%** | **60** | **47.7%** | **67.9%** | **18.5x** |
407
+ | kmedoids | 10% | 60 | 46.9% | 66.9% | 14.9x |
408
+ | facility | 10% | 60 | 46.8% | 66.8% | 11.5x |
409
+ | random | 10% | 60 | 44.3% | 63.1% | 10.3x |
410
+ | dpp | 10% | 60 | 42.9% | 61.1% | 13.7x |
411
+ | fps | 10% | 60 | 40.6% | 57.9% | 21.4x |
412
+
413
+ ### Robot Framework (126 tests, 63.5% full coverage)
414
+
415
+ | Strategy | Selection | Tests | Coverage | Retention | Speedup |
416
+ |---|---|---|---|---|---|
417
+ | *(full suite)* | 100% | 126 | 63.5% | baseline | 1.0x |
418
+ | **fps_multi** | **50%** | **63** | **61.6%** | **97.0%** | **1.5x** |
419
+ | facility | 50% | 63 | 61.6% | 96.9% | 1.5x |
420
+ | fps | 50% | 63 | 61.2% | 96.4% | 1.6x |
421
+ | kmedoids | 50% | 63 | 60.5% | 95.3% | 1.5x |
422
+ | dpp | 50% | 63 | 58.5% | 92.0% | 1.7x |
423
+ | random | 50% | 63 | 57.2% | 90.1% | 2.3x |
424
+ | **facility** | **20%** | **26** | **51.8%** | **81.5%** | **4.4x** |
425
+ | kmedoids | 20% | 26 | 47.5% | 74.8% | 5.5x |
426
+ | random | 20% | 26 | 46.0% | 72.5% | 5.7x |
427
+ | fps | 20% | 26 | 45.3% | 71.4% | 3.1x |
428
+ | fps_multi | 20% | 26 | 45.3% | 71.4% | 2.9x |
429
+ | dpp | 20% | 26 | 43.9% | 69.0% | 4.6x |
430
+ | **kmedoids** | **10%** | **13** | **42.3%** | **66.6%** | **11.3x** |
431
+ | dpp | 10% | 13 | 40.9% | 64.3% | 10.7x |
432
+ | facility | 10% | 13 | 40.2% | 63.3% | 12.9x |
433
+ | random | 10% | 13 | 37.6% | 59.2% | 11.3x |
434
+ | fps_multi | 10% | 13 | 37.5% | 59.1% | 10.7x |
435
+ | fps | 10% | 13 | 33.2% | 52.3% | 8.3x |
436
+
437
+ ### Key Findings
438
+
439
+ - **50% selection retains 92-97% of coverage** across all strategies — the diversity algorithms select tests maximizing behavioral breadth, with minimal redundancy loss
440
+ - **Facility location excels at 20% selection** — 83.6% retention on pytest, 81.5% on Robot Framework, making it the best choice for aggressive smoke-test suites
441
+ - **kmedoids matches facility at 20%** on pytest (83.1% retention) and leads at 10% on Robot Framework (66.6%)
442
+ - **fps_multi leads at 10% pytest** (67.9% retention) where initial-point sensitivity matters most
443
+ - **DPP performs well at 50%** (93.9% retention, matching FPS) but drops at 20% due to FPS fallback for large k values
444
+ - **All diversity strategies outperform random** at 50% by 2-7 percentage points of retention
445
+ - At 50% robot selection, fps_multi achieves **97% retention** — meaning half the tests contribute almost no incremental coverage
446
+
322
447
  ## Performance
323
448
 
324
449
  Benchmarked on 384-dimensional normalized vectors:
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "robotframework-testselection"
7
7
  dynamic = ["version"]
8
- description = "Vector-based diverse test case selection for Robot Framework"
8
+ description = "Vector-based diverse test case selection for Robot Framework and pytest"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = { text = "Apache-2.0" }
@@ -14,6 +14,7 @@ authors = [
14
14
  ]
15
15
  keywords = [
16
16
  "robotframework",
17
+ "pytest",
17
18
  "testing",
18
19
  "test-selection",
19
20
  "diversity",
@@ -26,6 +27,7 @@ classifiers = [
26
27
  "Framework :: Robot Framework",
27
28
  "Framework :: Robot Framework :: Library",
28
29
  "Framework :: Robot Framework :: Tool",
30
+ "Framework :: Pytest",
29
31
  "Intended Audience :: Developers",
30
32
  "License :: OSI Approved :: Apache Software License",
31
33
  "Operating System :: OS Independent",
@@ -76,6 +78,9 @@ all = [
76
78
  [project.scripts]
77
79
  testcase-select = "TestSelection.cli:main"
78
80
 
81
+ [project.entry-points.pytest11]
82
+ diverse-selection = "TestSelection.pytest.plugin"
83
+
79
84
  [tool.hatch.version]
80
85
  path = "src/TestSelection/__init__.py"
81
86
 
@@ -128,3 +133,9 @@ module = [
128
133
  "robot.*",
129
134
  ]
130
135
  ignore_missing_imports = true
136
+
137
+ [dependency-groups]
138
+ dev = [
139
+ "coverage>=7.13.4",
140
+ "pytest-cov>=7.0.0",
141
+ ]
@@ -1,3 +1,3 @@
1
1
  """Vector-based diverse test case selection for Robot Framework."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.3.0"