arduino-cli icon indicating copy to clipboard operation
arduino-cli copied to clipboard

cli: use cached index with lib search (#1624)

Open ardnew opened this issue 3 years ago • 1 comments
trafficstars

Please check if the PR fulfills these requirements

  • [x] The PR has no duplicates (please search among the Pull Requests before creating one)
  • [x] The PR follows our contributing guidelines
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)
  • [ ] UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce? Feature
  • What is the current behavior? A new copy of library_index.json is downloaded every time lib search is called (unconditionally).
  • What is the new behavior? A new copy of library_index.json is downloaded every time lib search is called and either one of the following conditions exists:
    1. The index has never been downloaded
    2. The time since the last index update is greater than one hour
  • Other information:
    • Fixes: #1624
    • Changes based on: #1063
    • Need assistance adding test cases and documentation for this change

See how to contribute

ardnew avatar Jul 01 '22 19:07 ardnew

I think that just removing these two lines https://github.com/arduino/arduino-cli/blob/f556aff7079ac5b02683f305329c90f8755c50f0/test/test_lib.py#L456-L457 should be enough to fix the integration tests.

cmaglie avatar Jul 21 '22 10:07 cmaglie