-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor export service to accomodate polling printer and disk #1615
Refactor export service to accomodate polling printer and disk #1615
Commits on Jan 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for c279e61 - Browse repository at this point
Copy the full SHA c279e61View commit details -
Refactor reorganize export module
The new directory structure will make extension easier.
Configuration menu - View commit details
-
Copy full SHA for 33cc56d - Browse repository at this point
Copy the full SHA 33cc56dView commit details -
Refactor use QSignalSpy to assert on signal emissions
Besides being the dedicated tool to assert on Qt signal emissions, QSignalSpy can track when signals are emitted from other signals, which the mocking strategy misses. Example: some_signal.connect(some_other_signal) # verify that some_other_signal is emitted See https://doc.qt.io/qt-5.15/qsignalspy.html
Configuration menu - View commit details
-
Copy full SHA for 0c185d2 - Browse repository at this point
Copy the full SHA 0c185d2View commit details -
Refactor deprecate export.Export test file
I'll use an expand and contract pattern to refactor the export.Service tests, and keeping this file distinct while it is used as a reference will be more convenient and minimize the change sets. Important: this file is still fully operational and will be kept as such until all deprecated methods have been removed from export.Export (soon to be renamed export.Service).
Configuration menu - View commit details
-
Copy full SHA for 989b94c - Browse repository at this point
Copy the full SHA 989b94cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee41aa6 - Browse repository at this point
Copy the full SHA ee41aa6View commit details -
Rename export.Service API signals (backwards compatible)
Refactor tests to: - distinguish testing of GUI API, and CLI API internals - improve readability
Configuration menu - View commit details
-
Copy full SHA for ebb9e51 - Browse repository at this point
Copy the full SHA ebb9e51View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae7fbb4 - Browse repository at this point
Copy the full SHA ae7fbb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3869f7b - Browse repository at this point
Copy the full SHA 3869f7bView commit details -
Refactor extract export CLI interface (part 2)
Decorate static methods (from what didn't need to be class methods) Tests were minially modified: patching static methods must be done unsing unittest.mock.patch.object to preserve the independence of the unit tests. Assigning to the class attributes directly does modify the class for the entire test session. (Not desirable.)
Configuration menu - View commit details
-
Copy full SHA for e8cfab2 - Browse repository at this point
Copy the full SHA e8cfab2View commit details -
Refactor remove unused export.Service alias
I am leaving the deprecated tests as untouched as possible to make easier to review the changes.
Configuration menu - View commit details
-
Copy full SHA for 86def51 - Browse repository at this point
Copy the full SHA 86def51View commit details -
Refactor make export service a module instance
This will ensure that one one instance of the export service queries the sd-devices CLI. That was already the case, but nothing was done to suggest it. Additionally, this will allow to simplify the export service injection by making possible to retrieve it like a logger. Note: I haven't stopped injecting the export_service into the main.Window because I couldn't figure out how to prevent what seems to be a fixture scope error that affects only half of the integration tests. That seems like something that can be resolved, so I don't consider it to be a sign of export.Service being a bad idea.
Configuration menu - View commit details
-
Copy full SHA for 9c752e9 - Browse repository at this point
Copy the full SHA 9c752e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d53e22 - Browse repository at this point
Copy the full SHA 0d53e22View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0130f43 - Browse repository at this point
Copy the full SHA 0130f43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 073597f - Browse repository at this point
Copy the full SHA 073597fView commit details -
Refactor remove/rename references to preflight checks in export.Servi…
…ce (1) These are now replaced by "printer check" and "disk check" which have the advantage of referring to concrete physical devices.
Configuration menu - View commit details
-
Copy full SHA for d5426ea - Browse repository at this point
Copy the full SHA d5426eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 833f45c - Browse repository at this point
Copy the full SHA 833f45cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e835f3b - Browse repository at this point
Copy the full SHA e835f3bView commit details -
Refactor remove deprecated methods, rename for consitency
Rename disk functions in export.CLI and export.Service Rename printer functions in export.CLI and export.Service The CLI now encapsulates all "preflight" references, so that neither the CLI or the Service expose them publicly. (References remain on the export.Device and dialogs, but those can now be removed for consitency with the export.Service.) Refactor remove unnecessary methods that were already deprecated Note: some of the deprecated tests were testing private methods that are currectly CLI behavior. This commit moves that testing to the appropriate file.
Configuration menu - View commit details
-
Copy full SHA for bf80ff3 - Browse repository at this point
Copy the full SHA bf80ff3View commit details -
Configuration menu - View commit details
-
Copy full SHA for d6bcbbd - Browse repository at this point
Copy the full SHA d6bcbbdView commit details -
Refactor replace deprecated service tests
With the new separation of concerns, the behavior is tested in three differemt component: - the service, that exposes the public API for the export module - the CLI that interfaces the service and Qubes OS tooling - the archive that is the CLI relies on but has no relation to Qubes OS
Configuration menu - View commit details
-
Copy full SHA for a65b6d0 - Browse repository at this point
Copy the full SHA a65b6d0View commit details -
Refactor remove unnecessary export.Service injection
The export.getService() function allows to obtain the export service instance wherever necessary without needing to inject it through all the parent widgets. This is a double-edged sword, as it makes the injection more implicit, but it is a pattern that is commonly used for singletons, e.g. loggers. Use thoughtfully, and remember that injecting the export service explicitly in some widgets is always possible! Next steps: as soon as the export.Device is not longer necessary, then the export.Service type doesn't need to be exported anymore.
Configuration menu - View commit details
-
Copy full SHA for 7b740a8 - Browse repository at this point
Copy the full SHA 7b740a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd62bdd - Browse repository at this point
Copy the full SHA cd62bddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6515406 - Browse repository at this point
Copy the full SHA 6515406View commit details -
Add deprecated interface to export.Disk
This interface allows to replace the export.Device (deprecated) by the export.Disk in the export dialog with minimal changes. It shouldn't be used for any new developments.
Configuration menu - View commit details
-
Copy full SHA for a9b2788 - Browse repository at this point
Copy the full SHA a9b2788View commit details -
Ensure export.Disk signals return no errors
The native errors are already available as disk.last_error.
Configuration menu - View commit details
-
Copy full SHA for 8a8d8b0 - Browse repository at this point
Copy the full SHA 8a8d8b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94d7f0c - Browse repository at this point
Copy the full SHA 94d7f0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cf0f2f - Browse repository at this point
Copy the full SHA 9cf0f2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 16aa6ec - Browse repository at this point
Copy the full SHA 16aa6ecView commit details -
Resetting the export.Service as part of the setup of the tests is a compromise. It is a smell, that accurately points at other tests not performing an adequate teardown. I haven't fixed those this time around because the way they are written doesn't provide an obvious place to teardown related tests, so adding teardown operations introduces a significant amount of duplication. It seems to me that athough less than ideal, this will prove more reliable and more less error-prone for the time being.
Configuration menu - View commit details
-
Copy full SHA for ca27689 - Browse repository at this point
Copy the full SHA ca27689View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4480a41 - Browse repository at this point
Copy the full SHA 4480a41View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd575de - Browse repository at this point
Copy the full SHA bd575deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a1cdfa - Browse repository at this point
Copy the full SHA 3a1cdfaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 47888de - Browse repository at this point
Copy the full SHA 47888deView commit details -
Configuration menu - View commit details
-
Copy full SHA for efe9a15 - Browse repository at this point
Copy the full SHA efe9a15View commit details -
Configuration menu - View commit details
-
Copy full SHA for add8960 - Browse repository at this point
Copy the full SHA add8960View commit details -
Configuration menu - View commit details
-
Copy full SHA for bdd94e2 - Browse repository at this point
Copy the full SHA bdd94e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for c77817e - Browse repository at this point
Copy the full SHA c77817eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c634cee - Browse repository at this point
Copy the full SHA c634ceeView commit details -
Configuration menu - View commit details
-
Copy full SHA for afd18ec - Browse repository at this point
Copy the full SHA afd18ecView commit details
Commits on Jan 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 73d82ea - Browse repository at this point
Copy the full SHA 73d82eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for fbe4085 - Browse repository at this point
Copy the full SHA fbe4085View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d08613 - Browse repository at this point
Copy the full SHA 6d08613View commit details