Skip to content
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

Add Dockerfiles for testing, fix tests and style #408

Merged
merged 22 commits into from
Jul 31, 2018
Merged

Add Dockerfiles for testing, fix tests and style #408

merged 22 commits into from
Jul 31, 2018

Conversation

KeyWeeUsr
Copy link
Contributor

Pretty much first I've attempted to start X11/Xserver/whatever in Docker container, however afaik (and from a lot of similar issues) I think that's not possible without X11 forwarding into the container (which basically kills the whole point), so I switched to a solution where we can add non-X11/non-display dependent binaries into the container and test against those + add some mocks if necessary i.e. something on plyer/tests/test_battery.py style.

Better said, if the binary we use on GNU/Linux distros provides a useful output and/or we parse something, it'd be really useful to get the full output and mark the versions of a binary it was tested with instead of just mocking (basically - X called with Y? yup... and what now if we need to parse?). If the binary is only like notify-send, then just the mocking is safe enough (no better choice afaik at least). Regarding Windows (and perhaps even OSX) the testing there is easy because there is an API and if some window pops out we can check the title, class, etc (see test for Windows at plyer/tests/test_notification.py).

Regarding Android/iOS, we can basically do just the mocking but it'd be nice to at least note the SDK it was tested with, so that if some API disappears we know what happened.

Also I fixed upower battery API because previously it parsed everything which if you have multiple batteries or a keyboard with battery or what not it won't provide the right results. I switched to using the device BAT0 which has been already specified in that file.

I added Pylint too, because I've noticed that with each platform there is a different style of coding and I think in the long run it'll trim the mess and it'll be more readable. And I'm still not sure what's OSX's problem with Py3 because I've run the tests on Ubuntu, Mint, Fedora, in the containers and on Windows, yet OSX kind of irritates me with this silly fail for reload().

https://coveralls.io/github/KeyWeeUsr/plyer, https://travis-ci.org/KeyWeeUsr/plyer, the coverage is obviously lower because I removed two dummy files and made it strictly only for the plyer package and nothing else.

@KeyWeeUsr KeyWeeUsr merged commit 9033727 into kivy:master Jul 31, 2018
@KeyWeeUsr KeyWeeUsr deleted the docker_tests branch July 31, 2018 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants