-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 🙂. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving within the directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 tests
|
Invalidate cache not only when file is modified inside policy dir, but
also when it's moved in or out.