agentos-project/agentos

Tests should clear (or not use) local repo caches

Opened this issue · 1 comments

andyk commented

See discussion in #310

andyk commented

Copying this text over from a comment in #310:

Clearing these caches can be tricky if modules that live in them have already been loaded into a python process. Just ran into this when trying to update the tests to clear the repo cache, but then Windows (though not Linux or MacOs) threw an exception during test_component_from_github_no_venv when trying to clear the cache because test_component_from_github_with_venv had already run and loaded some modules from that same local github repo.

I now think perhaps we should only cache repos locally into directories that have the name of the github hash, and then we can also separately cache the mapping between branch names and repos.

Dulwich might also have a better way of handling these things.