Uh oh!
There was an error while loading. Please reload this page.
fix: load cache error when CacheDecoder object is not callable - #226
Conversation
fejta-bot
commented
Jan 29, 2021
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
yliaog
commented
Jan 31, 2021
thanks for the pr, could you please add a test case? |
jamesgetx
commented
Feb 1, 2021
Ok, I will add it later:) |
hi @yliaog. I have pushed the test case, but i'm not sure there is any other better solutions to test the code |
fabianvf
commented
Feb 1, 2021
/lgtm |
| def setUpClass(cls): | ||
| cls.config = base.get_e2e_configuration() | ||
| def test_init_cache_from_file(self): |
There was a problem hiding this comment.
so if you run the test without the fix, the test will fail, and there will be exception, right?
There was a problem hiding this comment.
yes. without the fix, Discoverer.__init_cache will raise 'CacheDecoder' object is not callable then call self.invalidate_cache(), finally self._write_cache() will be called to modify Discoverer.__cache_file
yliaog
commented
Feb 2, 2021
/lgtm |
k8s-ci-robot
commented
Feb 2, 2021
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jamesgetx, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix the code snippet
self._cache = json.load(f, cls=CacheDecoder(self.client))raise'CacheDecoder' object is not callable