Sorry for the sudden request. Marco and I are working with Nuts again and might be doing something wrong with the pytest ecosystem. It would be great if you could take a look, but it's completely okay if you don't have the time or interest.
Nuts reinitialize the Nornir object for each test case, reloading the inventory each time. This is less critical with an inventory from YAML files on disk, but it is when pulling from an API. We've been trying to cache the inventory and tried various things, but nothing feels perfectly clean.
Currently, we're using pytestconfig.cache to store data, and I've noticed the cache persists across multiple executions. We thought this might be useful when troubleshooting test cases or when the inventory doesn't change, so we've added an option to avoid resetting the cache at the start of the session.
Are we on the wrong track here? Are we completely misusing the cache idea?
PS: I am happy to invite you to a couple of chopfab, coffee or Mate ;)
Hey @The-Compiler
Sorry for the sudden request. Marco and I are working with Nuts again and might be doing something wrong with the
pytest
ecosystem. It would be great if you could take a look, but it's completely okay if you don't have the time or interest.Nuts reinitialize the Nornir object for each test case, reloading the inventory each time. This is less critical with an inventory from YAML files on disk, but it is when pulling from an API. We've been trying to cache the inventory and tried various things, but nothing feels perfectly clean.
Currently, we're using
pytestconfig.cache
to store data, and I've noticed the cache persists across multiple executions. We thought this might be useful when troubleshooting test cases or when the inventory doesn't change, so we've added an option to avoid resetting the cache at the start of the session.Are we on the wrong track here? Are we completely misusing the cache idea?
PS: I am happy to invite you to a couple of chopfab, coffee or Mate ;)