Fix downloading diagnostics more than once#661
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #661 +/- ##
=======================================
Coverage 97.41% 97.41%
=======================================
Files 62 62
Lines 10724 10725 +1
=======================================
+ Hits 10447 10448 +1
Misses 277 277 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
This PR makes a
deepcopyof the device'soriginal_signaturebefore modifying the it for a friendlier version in the JSON.Otherwise, we modify the original
device.original_signatureand fail with the error below when trying to download diagnostics for the same device a second time.This fixes the following error when downloading diagnostics:
Additional information
We can also test the diagnostics stay the same for every device, but that seems a bit overkill:
6d3c660(this PR)Now, the PR only tests it for one device (which has an
original_signature). The test is intest_discover.py, which isn't great, but just creatingtest_diagnostics.pyfor this seems a bit overkill? But I can do that, of course.It's under the existing diagnostics usage in
test_discover.pyfor now.