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
fix: MachineType f-string #226
fix: MachineType f-string #226
Conversation
Thanks for your contribution and catching the failure. Can you add or extend our test suite to cover this failure? Let me know if you need assistance there. The commit has no description. Can you include the PR description as description for your commit. nitpick: Can you use "f-string" (instead of "fstring") everywhere (especially in the git commit title)? |
f993ece
to
3f1eabf
Compare
I took the body of my first comment and added it to the description of the commit. I left the title alone because it seems like the convention is feature (e.g. "fix:", "ci:", etc) commits.
Done.
I would appreciate some assistance and/or clarity on this. Do you mean that you like to see a test of |
Yes.
That task would be asked too much and probably not the correct approach to unit testing. Another nitpick: You could mention the culpit commit 5a50433 in a "Fixes" line. Example: https://github.com/canonical/apport/commit/3c1bf853d8e691766f75f13e8ff625487f8b2f07.patch |
aeeff60
to
f2a9546
Compare
Codecov Report
@@ Coverage Diff @@
## main #226 +/- ##
=======================================
Coverage 82.98% 82.98%
=======================================
Files 92 92
Lines 18748 18748
=======================================
Hits 15558 15558
Misses 3190 3190
|
Agreed, but I wanted to sure!
Done! I'm not a huge fan of how much patching went into this, but in my opinion testing here should be about making sure any dynamically created keys (like MachineType) are interpolated correctly. That being said I put this into the unit tests and mocked all the other data. We could put this into integration test but this seemed to be the simpler approach. Lastly I refactored out collecting udevdb information. We should write a separate test to guarantee the anonymization is working, but probably at a later date. |
Wow, that test case has a lot of mocking. The idea: Setting |
I'll prepare that test case. |
ed37785
to
d15d18b
Compare
I rebased this branch to include some edits to make the linters happy and cleanup my print statement (whoops).
Would it be better to move testing of |
It looks like when things were changed over to f-strings this one line missed the "f". I did some basic searches through the rest of the code to find other instances of this but couldn't find any. Moved to attach_dmi since it's derived from values there. fixes: 5a50433 ("refactor: Use f-strings everywhere") Signed-off-by: Chris Peterson <chris.peterson@canonical.com>
d15d18b
to
f303ea4
Compare
Fixes MachineType key to be an f-string instead of a regular string
It looks like when things were changed over to f-strings this one line missed the "f". I did some basic searches through the rest of the code to find other instances of this but couldn't find any.