Test suite for MagicMirror²
I’m working in a test suite for MagicMirror². I think is a good point to improvement more MagicMirror².
Now, the testing is doing manually and test suite can enable to test automatic features, fixes or prevent something is broker for a change introduced.
The project is bigger every day, its I really like it. Many contribuitors include proposals and new change every day. Some stats
Beeetwen the release 2.0.5 to 2.1.0 was
74 files changed, 3288 insertions(+), 755 deletions(-)
and pushed 257 commits around 2.8 commits per day.
I’m looking ideas, pushed or if someone is interested to collaborated. Maybe Trello, this forum or other method can be organizated the work.
The first way to do this is elaborate a list of test to develop.
I would like hear your comments.
I agree, seeing MagicMirror become such a great success with lots of contributions and improvements is really nice. To keep the quality consistent and MagicMirror reliable with so many changes, it would really help to run tests automatically as much as possible.
Maybe I’ll be able to work on some test-cases too, so feel free to include me in any communication. I’m also on Trello, so would be able to join there too.
I know your help will to be great.
I recently a create a simple Trello board https://trello.com/b/RMlo1mDy/test-suite-magicmirror. Three state: Todo - Doing - Done
Todo: Ideas and planning of tests.
Doing: Task self asignated or requested one by someone. This state if someone is working in this task.
Done: Pushed in Pull Request or commited.
Every interested in help this area, feel free send me by IM or private message of your Trello account.
Great idea to setup test suite. Thanks for getting it started @roramirez. I’ve made some minor cleanup changes on top of your initial work, PR is sitting on GitHub. I will try to contribute to tests as much as I can.
@morozgrafix Thanks!, Is already merged :)
Update and news:
Thanks to @qistoph we have 2 improvement
- Now every commit introduced previous is checked by tests suite in Travis.
- Added a new test case https://github.com/MichMich/MagicMirror/pull/648/files
Also, @qistoph and I suggest have two side for test.
- The backend application and node_helpers
For this last is possible use Spectron … but… is needed will set
true. One idea is check a enviroment variable and if present set this variable to true.
For other way, work with serveronly and get test from client side from there.
If some have comments and ideas from this is welcome.
PS: I have a sample of use spectron https://github.com/roramirez/MagicMirror/commit/c99581c15b4cb008b2800f40ecbaf9c9862c7ceb
Okay, just another brainfart.
For the tests to run consistently and in such a way that we can test whatever is needed, we’re probably going to need a separate configuration file, maybe even a couple. If I’ve read the code correctly, we could set
nodeIntegrationin this config, without touching the code in MM to check for environment settings…
This would be cleaner imho
@qistoph Sound good and I like it. Now we can set by electronOptions in configuration file, same logic as you say.
The point to resolved is how can tell to MagicMirror read a specific file of configuration. Now is set in hardcoded. With than can be create multiples instances of configuration files into tests suite (tests directory) and run test to these. Added this task in Trello.
Today I’ve working a problem of issue with Electron and other things, all details here
After testing in two enviroment different for Lite and with Pixel on Raspbian, the process is long because you need the create SD and follow the instruction and check what could be the problem.
I think this can be automatic and running on a hosted system or my own machine. Someone know howto use a arm image for RaspberryPi and run like a Docker’s container? for run a test of enviroments. I think can be a help to include in the Test Suite.
@roramirez I haven’t played with Docker in a while and never tried raspbian on a docker container. Quickly glanced at DockerHub and it seems that people are able to do that. https://hub.docker.com/search/?isAutomated=1&isOfficial=0&page=1&pullCount=0&q=raspbian&starCount=0
I may take a look into it, but it all depends on my availability.