policy-daemon: invalidate cache on file move too#170
Conversation
Invalidate cache not only when file is modified inside policy dir, but also when it's moved in or out.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #170 +/- ##
==========================================
- Coverage 78.01% 77.99% -0.03%
==========================================
Files 54 54
Lines 9637 9664 +27
==========================================
+ Hits 7518 7537 +19
- Misses 2119 2127 +8 ☔ View full report in Codecov by Sentry. |
|
Looks geat, except there are no tests 🙂. |
DemiMarie
left a comment
There was a problem hiding this comment.
One more test that could be added, but IIUC it won’t add new coverage.
| # now move out | ||
| file_moved.rename(file) | ||
|
|
||
| await asyncio.sleep(1) | ||
|
|
||
| assert cache.outdated | ||
|
|
||
| cache.get_policy() | ||
|
|
||
| call = unittest.mock.call(policy_path=policy_path) | ||
| assert mock_parser.mock_calls == [call, call, call] |
There was a problem hiding this comment.
What about moving within the directory?
There was a problem hiding this comment.
It's then both move from and move to, so this case is covered too.
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024062721-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024062115-4.3&flavor=update
Failed tests11 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/103633#dependencies 5 fixed
Unstable testsDetails
|
Invalidate cache not only when file is modified inside policy dir, but
also when it's moved in or out.