-
Notifications
You must be signed in to change notification settings - Fork 15
Custom Benchmark fixture for running benchmark tests when the pytest-benchmark plugin is disabled #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍(Review updated until commit 3c76a95)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 3c76a95 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit aa33d77
Suggestions up to commit 56108b5
|
Persistent review updated to latest commit aa33d77 |
Persistent review updated to latest commit 3c76a95 |
@@ -252,7 +256,9 @@ def run_benchmarking_tests( | |||
result_file_path = get_run_tmp_file(Path("pytest_results.xml")) | |||
result_args = [f"--junitxml={result_file_path.as_posix()}", "-o", "junit_logging=all"] | |||
pytest_test_env = test_env.copy() | |||
pytest_test_env["PYTEST_PLUGINS"] = "codeflash.verification.pytest_plugin" | |||
pytest_test_env["PYTEST_PLUGINS"] = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need the benchmarking plugin here?
closing for now as there are other ways of achieving the same goal |
PR Type
Enhancement, Tests
Description
Introduce custom pytest benchmarking plugin
Provide no-op
benchmark
fixture implementationRegister
@pytest.mark.benchmark
pytest markerInclude plugin in test runners’ PYTEST_PLUGINS settings
Changes walkthrough 📝
test_benchmark_bubble_sort.py
Add benchmark-marked test case
code_to_optimize/tests/pytest/benchmarks/test_benchmark_bubble_sort.py
test_sort_with_marker
using@pytest.mark.benchmark
@benchmark
custom_plugin.py
Implement custom benchmark fixture plugin
codeflash/benchmarking/plugin/custom_plugin.py
custom_plugin.py
defining a CustomBenchmark class"benchmark"
inpytest_configure
__call__
,pedantic
, and dynamic methodsgroup
,name
,fullname
,params
,extra_info
test_runner.py
Include custom benchmark plugin in test runners
codeflash/verification/test_runner.py
PYTEST_PLUGINS
to includecustom_plugin
in three runnerstests