Commit graph

2855 commits

Author SHA1 Message Date
Saurabh Misra
c0343356d0 release/v0.6.19 2024-08-22 15:33:08 -07:00
Saurabh Misra
efb925b0c6
Merge pull request #931 from codeflash-ai/release/v0.6.18
release/v0.6.18
2024-08-22 15:31:11 -07:00
Saurabh Misra
94afdd0515 release/v0.6.18 2024-08-22 15:30:53 -07:00
Saurabh Misra
e9b086829e
Merge pull request #915 from codeflash-ai/fix-instrumentation-generally
Fix existing test instrumentation in a general manner
2024-08-22 13:01:45 -07:00
Saurabh Misra
94c88cf77f
Merge pull request #930 from codeflash-ai/codeflash/optimize-pr915-2024-08-22T08.51.49
️ Speed up function `generated_test_critic` by 43% in PR #915 (`fix-instrumentation-generally`)
2024-08-22 12:43:56 -07:00
Saurabh Misra
6d7520d3ec
Update cli/codeflash/result/critic.py 2024-08-22 12:43:47 -07:00
codeflash-ai[bot]
09113d5494
️ Speed up function generated_test_critic by 43% in PR #915 (fix-instrumentation-generally)
To optimize the given Python program, we focus on improving the efficiency of the list comprehension and conditional checks. One possible optimization is to reduce the number of iterations and checks by using a generator expression and adding early termination conditions. Here is the optimized version of your code.



### Explanation of Optimizations.
1. **Generator Expression:** Instead of creating a list of `passed_tests` and then checking its length, the code uses a generator expression to iterate over `test_results`. This averts the overhead of list creation and directly counts the passed tests.
2. **Early Exit:** The loop can terminate early if more than one test has passed, providing an immediate return of `True`. This approach avoids unnecessary iterations.
3. **Minimal Storage:** Instead of storing a list of all passed tests, we only store the reference to the first passing test and count the number of passing tests. This reduces memory usage.

With these changes, the function should handle large datasets more efficiently both in terms of runtime and memory usage.
2024-08-22 08:51:54 +00:00
Saurabh Misra
e5c7e7b5d8 rename to test_quantity_critic 2024-08-22 00:44:46 -07:00
Saurabh Misra
f9a9b00f3c try to fix the test for all python versions 2024-08-22 00:38:35 -07:00
Saurabh Misra
201fc4bd82 try to fix the test for all python versions 2024-08-22 00:35:09 -07:00
Saurabh Misra
bb70593ac6 Fix double *args in test instrumentation 2024-08-22 00:28:25 -07:00
Saurabh Misra
93636108e0 make timeout_decorator needed only for unittest tests 2024-08-22 00:22:47 -07:00
Saurabh Misra
62a660af91 fix one test 2024-08-22 00:01:26 -07:00
Saurabh Misra
8e082800f2 - fix instrumentation for complex test conditions
- fix instrumentation for methods
- fix generated_test_critic function
- create a separate performance_improvement function
- fix tests and add new tests, also make them run from any cwd
2024-08-21 22:33:27 -07:00
Saurabh Misra
3c79af7d27
Merge pull request #913 from codeflash-ai/remove-deceptive-log-message
Remove deceptive log message
2024-08-20 16:27:47 -07:00
RD
15dc259d88
Merge branch 'main' into remove-deceptive-log-message 2024-08-20 15:20:48 -07:00
RD
33f155c025
Merge pull request #911 from codeflash-ai/single-quotes-python-version-in-yaml
Fix the cmd-init actions file
2024-08-20 15:08:17 -07:00
Saurabh Misra
643bf9ee72 Remove deceptive log message 2024-08-20 14:28:33 -07:00
Saurabh Misra
af592b2fad modify the comment 2024-08-20 14:07:41 -07:00
Saurabh Misra
e37e8a97b7 python version should be in single quotes, otherwise it is read as a number 2024-08-20 13:58:49 -07:00
Saurabh Misra
7f91a64192
Merge pull request #910 from codeflash-ai/users-table-created-at
Add a created_at column for users table
2024-08-16 19:18:19 -07:00
Saurabh Misra
68c2d162a6 Add a created_at column for users table 2024-08-16 19:12:37 -07:00
RD
ac570bc2ee
Merge pull request #908 from codeflash-ai/Pypi-readme
README for Pypi
2024-08-13 23:24:45 -07:00
RD
b60db9215b
Merge branch 'main' into Pypi-readme 2024-08-13 23:13:20 -07:00
Ihita Mandal
695c0fc5e1
Merge pull request #907 from codeflash-ai/remove-incorrect-generated-tests
CF-374 Do not count optimizations if only one generated test passes
2024-08-13 14:54:33 -07:00
ihitamandal
3ffd40e718 Merge remote-tracking branch 'origin/main' into remove-incorrect-generated-tests 2024-08-13 14:37:54 -07:00
Saurabh Misra
6cbd9b9f5d
Merge pull request #909 from codeflash-ai/fix-logging-and-bad-user-error
fix db logging and bad user error
2024-08-13 13:18:35 -07:00
ihitamandal
5355c87923 Add support for replay tests 2024-08-13 10:43:34 -07:00
RD
c5058c849e README for Pypi 2024-08-13 01:36:44 -07:00
Saurabh Misra
501dded5f5 fix db logging and bad user error 2024-08-12 21:38:07 -07:00
Ihita Mandal
ce970d9851
Minor changes 2024-08-12 15:45:34 -07:00
ihitamandal
4e9c916e51 Modify the generated test critic 2024-08-12 15:42:49 -07:00
RD
60451b946e README for Pypi 2024-08-12 15:42:00 -07:00
ihitamandal
de842707e2 Merge remote-tracking branch 'origin/main' into remove-incorrect-generated-tests 2024-08-12 15:37:36 -07:00
ihitamandal
6266a46e6a Add test critic to only allow optimizations if more than one generated test pass 2024-08-12 15:36:18 -07:00
Saurabh Misra
0df93ce04e
Merge pull request #906 from codeflash-ai/release/v0.6.17
Release v0.6.17
2024-08-11 21:21:17 -07:00
Saurabh Misra
d53e90fab7 Release v0.6.17 2024-08-11 21:14:18 -07:00
Saurabh Misra
a55f769a87
Merge pull request #905 from codeflash-ai/python-3.9-and-up
Update the dependency spec to python=^3.9
2024-08-11 21:11:46 -07:00
Saurabh Misra
b08329a560 Update the dependency spec 2024-08-11 21:04:35 -07:00
Saurabh Misra
ff72b7b206
Merge pull request #904 from codeflash-ai/release/v0.6.16
release v0.6.16
2024-08-11 21:02:03 -07:00
Saurabh Misra
c4c552dfdb release v0.6.16 2024-08-11 21:00:19 -07:00
Saurabh Misra
6106165b06
Merge pull request #903 from codeflash-ai/discover-pytest-tests-properly
Pytest test discovery solution
2024-08-11 20:49:18 -07:00
Saurabh Misra
62c0b6a212
Merge branch 'main' into discover-pytest-tests-properly 2024-08-11 20:45:07 -07:00
Saurabh Misra
fd6394061d
Merge pull request #902 from codeflash-ai/remove-the-less-than-3.13-condition
max python version to 3.13
2024-08-11 20:44:59 -07:00
Saurabh Misra
0ab631d1e5
Merge branch 'main' into remove-the-less-than-3.13-condition 2024-08-11 20:44:49 -07:00
Saurabh Misra
8d86114794
Merge pull request #901 from codeflash-ai/manually-specific-trace-pyproject.toml
manually specify pyproject.toml file to the tracer
2024-08-11 20:44:34 -07:00
Saurabh Misra
b7f0093cdb don't check if branch pushed if running in --no-pr mode 2024-08-11 20:32:09 -07:00
Saurabh Misra
8322e28726 Run pytest in a separate process to avoid importing all the customer code into codeflash runtime 2024-08-11 20:25:19 -07:00
Saurabh Misra
5079d4b63b Make pytest test discovery a lot more robust, by removing console parsing 2024-08-11 19:04:31 -07:00
Saurabh Misra
d705b7f7cf add a max version 3.14 2024-08-11 17:08:21 -07:00