-
Notifications
You must be signed in to change notification settings - Fork 425
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
tests: Setup automated tests with pytest #2256
Conversation
This PR just adds a testing harness, right? The reason I ask is that a Solaar release will go out soon. If this PR doesn't affect Solaar then it can be part of the release. |
@MattHag |
I'll take a look. Yes, it only adds support for automated tests and as side effect tests, that the package can be installed. |
@MattHag Does this PR also allow running the tests locally? |
Yeah, sure.
|
@MattHag Tests work locally. |
@MattHag I wrote my first test - and found a bug! |
The reason for the given error is a missing dbus dependency, that is not pre-installed in the Ubuntu base image. I'll follow the installation page and add necessary dependencies. |
Yeah, that's a problem with installing Solaar. It depends on quite a few packages and some distributions don't have them installed by default. |
We can (later) add a Makefile with targets for the different installations, depending on distribution and operating system. This simplifies the local setup and GitHub CI can leverage the same install procedure. OS dependenciesFor GitHub and local Ubuntu installations, you could then use the same command, e.g. Python dependenciesThe pip dependencies can be installed with pip automatically. The default install would be |
With just two additional dependencies, it works on Ubuntu 22.04, which is used in our GitHub CI. |
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.
Looks good now
Replaces deprecated Node.js 16 actions. Related pwr-Solaar#2256, pwr-Solaar#2284
* Show pytest coverage in GitHub CI tests Related #1097 * Extend Makefile with installation and test targets Refactor setup steps to unify commands between Linux and macOS. Move bash commands into Makefile for consistency and enable local execution of GitHub CI commands corresponding Makefile targets. Install on Ubuntu: make install_ubuntu Install on Ubuntu for development: make install_ubuntu PIP_ARGS=."[test]" Fixes #2303 * Improve name of GitHub test actions Related #2303 * Upgrade GitHub actions to Node.js 20 Replaces deprecated Node.js 16 actions. Related #2256, #2284
Related #1097