fix: nightly hardening - retry parameter validation#19
Open
mouse-value-add wants to merge 1 commit intobrainsparker:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem\nThe retry utility accepts invalid runtime parameters (for example or negative delays), which can cause silent no-op behavior or runtime failures in instead of a clear configuration error.\n\n## Approach\n- Added upfront parameter validation in for:\n - \n - \n - \n - \n- Added focused async tests in to lock in behavior.\n\n## Verification\n- Ran: ============================= test session starts ==============================
platform darwin -- Python 3.9.6, pytest-8.4.2, pluggy-1.6.0
rootdir: /private/tmp/oss-nightly/PromptLens
configfile: pyproject.toml
plugins: anyio-4.12.1, asyncio-1.2.0, cov-7.1.0
asyncio: mode=strict, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 4 items
tests/test_retry_hardening.py .... [100%]
================================ tests coverage ================================
_______________ coverage: platform darwin, python 3.9.6-final-0 ________________
Name Stmts Miss Cover
promptlens/init.py 3 0 100%
promptlens/main.py 3 3 0%
promptlens/cli.py 169 169 0%
promptlens/exporters/init.py 6 6 0%
promptlens/exporters/base.py 15 15 0%
promptlens/exporters/csv_exporter.py 26 26 0%
promptlens/exporters/html_exporter.py 38 38 0%
promptlens/exporters/json_exporter.py 16 16 0%
promptlens/exporters/markdown_exporter.py 77 77 0%
promptlens/judges/init.py 3 3 0%
promptlens/judges/base.py 15 15 0%
promptlens/judges/llm_judge.py 71 71 0%
promptlens/judges/parser.py 107 107 0%
promptlens/judges/prompts.py 30 30 0%
promptlens/loaders/init.py 4 4 0%
promptlens/loaders/base.py 14 14 0%
promptlens/loaders/json_loader.py 23 23 0%
promptlens/loaders/yaml_loader.py 34 34 0%
promptlens/models/init.py 4 4 0%
promptlens/models/config.py 41 41 0%
promptlens/models/result.py 60 60 0%
promptlens/models/test_case.py 25 25 0%
promptlens/models/tools.py 74 74 0%
promptlens/providers/init.py 3 3 0%
promptlens/providers/anthropic.py 52 52 0%
promptlens/providers/base.py 23 23 0%
promptlens/providers/factory.py 21 21 0%
promptlens/providers/google.py 47 47 0%
promptlens/providers/http.py 67 67 0%
promptlens/providers/openai.py 57 57 0%
promptlens/providers/you.py 57 57 0%
promptlens/runners/init.py 2 2 0%
promptlens/runners/runner.py 96 96 0%
promptlens/utils/init.py 1 0 100%
promptlens/utils/cost.py 15 15 0%
promptlens/utils/diff.py 25 25 0%
promptlens/utils/retry.py 29 15 48%
promptlens/utils/timing.py 24 24 0%
TOTAL 1377 1359 1%
Coverage HTML written to dir htmlcov
============================== 4 passed in 0.25s ===============================\n- Result: 4 passed\n\n## Risks\n- Low risk. This is a fail-fast validation change. Existing callers with invalid values will now receive explicit immediately.\n\n## Rollback plan\n- Revert this PR commit to restore prior behavior if any downstream integration depends on permissive invalid inputs.