Skip to content

Make test caching opt-in with --cached #1464

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

Merged
merged 2 commits into from
May 12, 2022
Merged

Make test caching opt-in with --cached #1464

merged 2 commits into from
May 12, 2022

Conversation

eddiebergman
Copy link
Contributor

closes #1447

Use pytest --cached to have autosklearn items cached. If you don't include it, pytest will delete everything in the cache upon invocation.

Items will still be cached between the different tests in the same invocation.

Tested manually:

# Where the cache would exist
$ ls .pytest_cache/d
> . ..

# Slow, has to generate the automl instances
$ pytest test_automl/test_automl/test_performance_over_time.py
$ ls .pytest_cache/d
> . ..  

# Still slow, has to generate the automl instances
$ pytest --cached test_automl/test_automl/test_performance_over_time.py
$ ls .pytest_cache/d
> . ..  autosklearn-cache

# Much faster this time, only has to unpickle automl instances
$ pytest --cached test_automl/test_automl/test_performance_over_time.py
$ ls .pytest_cache/d
> . ..  autosklearn-cache

# Slow again, deletes the cached items this time
$ pytest test_automl/test_automl/test_performance_over_time.py
$ ls .pytest_cache/d
> . ..

@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #1464 (6dc3b90) into development (daa9ad6) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           development    #1464      +/-   ##
===============================================
- Coverage        84.31%   84.29%   -0.03%     
===============================================
  Files              147      147              
  Lines            11284    11287       +3     
  Branches          1934     1939       +5     
===============================================
  Hits              9514     9514              
+ Misses            1256     1255       -1     
- Partials           514      518       +4     

Impacted file tree graph

@mfeurer mfeurer merged commit 05ab635 into development May 12, 2022
@mfeurer mfeurer deleted the caching_opt_in branch May 12, 2022 19:45
eddiebergman added a commit that referenced this pull request Aug 18, 2022
* Make test caching opt-in `--cached`

* Remove unused param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching automl instances between pytest invocations as opt-in instead of opt-out
2 participants