-
Notifications
You must be signed in to change notification settings - Fork 42
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
Test suite #105
Comments
I would welcome the idea because I am getting back into using it, and now want to help you hack it. Do not know much about testing shell scripts, so naturally I googled it. SO: Unit tests for shells scripts shunit2: One of the answes from above, a unit test framework for shell scripts |
I am out of town this week in an area with weak WiFi...I may not be able to really test much until next Sunday, although I will be working on OpenPdroid update each night. But the pull requests have looked good in passing...I WILL review them when I return if not sooner. In order to really institute a testing framework, we would need a way to easily pass values and call some stub methods. Currently, I have several hundred ROMs of various vintage/origin that I run big changes through- not ideal. Our logging is pretty robust, just about everything that can go wrong or that we need to know is reported there. The auto-patcher command-line arguments allow us to pass values for romtype, patchdate and mods...perhaps just adding a test flag which then skipped the compiling/decompiling steps is the next step in creating a testing framework. Of course that would not protect us from any issues with compiling/recompiling...but some things simply require a full run to test. I just fixed a nasty bug related to recompiling for 2.9.7. I will also be thinking on this more. I also have much of my Auto-patcher 3.0 worked out in my head...if you are interestead we can talk about that as well. Thanks |
No worries. I just started to get into it and waited impatiently
Agreed. I saw the other ticket (meateor/autopatcher#116) and I started
Agreed, you logging is great. I really appreciate how easy your stuff
Well I would love to help with that too.
I am all ears. Let me know.
|
The testing unit I had in mind is not really for anyone's benefit but mine and yours and any other contributors. When I was working out the new apk_was_copied routine, I had to run through entire patching processes for each edit, it took forever. I would like to be able to run I sometimes come across situations where I want to test what happens with the script when something like apk_was_copied is combined with provisional use. Then I have to scourr user-submitted test logs for a rom with those matching symptoms. So a framework to test those sort of situations would be a huge improvement and time saver. Then we could simply think up test cases as they cross our minds and add them to a test-list. So when we run Some deeper investigation of I will briefly write up my next stage plan for the autopatcher in the appropriate issue and will link to it below. |
Cool, let me know what your thoughts are and I would be very down to help. As you might have guessed, #123 ideas about partitioning files came up because I was thinking about the testing suite stuff at the same time. But I am not sure that is the best way forward for you and others, so we will talk later and see what you think. UPDATE: And the getopt stuff sounds interesting, forgot to mention. And more importantly excuse the terrible formatting in my previous comment. I responded by email and I failed several attempts at getting quotes to work properly. C'est la vie. |
I am working on the "3.0.0" update and part of that is going to involve filtering out garbage files from the diff. As we make patches now, we simply decompile the files and diff them. So any meaningless change in unrelated files, even just registers, is also part of our patching process and acts as an additional point of failure. I am working on this now. and my current method for my test scripts is to hardcode in "--ignore=$FILE" when calling diff. But that only handles the files that we know about, and I think that basically every class in these jar files is a candidate to end up in our diffs. This is especially important to watch as the update involves splitting the diffs from .jar patches to .smali patches. No need to carry useless patches there at all. I bring this up here, because I would like to add a test that explicitly checks for just the .smali patches we need, and deletes the rest. This could be distributed to patch builders and then we could simply set it and forget it. |
Sounds cool. How can I help you with this moving forward then? |
I hope to have the test suite begin pretty soon. I don't thin it needs to be very complicated. The tests I would like to run don't have to be too complicated. Things like
etc. Ideally, everytime I find/fix a bug, I would pop over a write a quick test so it gets caught in the future. And then periodically we can just run the entire test suite and just let it run, with an output something like "28 out of 28 tests passed". Ideally, the same test suite could be used to test just one apk/jar from the files.txt...so if OpenPDroid modifies 5 jars/apks, we could call the test to just operate on the Mms for example. Currently, I modify the OpenPDroid files.txt to just read Mms.apk and then return it to original state when done. I would like a less error-prone approach. I am still open to the structure that you sent before, I just didn't know how you intended to implement it. If you have an idea, feel free to pitch it. I realize that this seems a lot for a bach script. But the update I am working on now should hopefully move us pretty close to universal patching and hopefully stock-rom support. If that gets humming as well as our current support for custom roms, then I will move forward and create an apk installer for the Play Store. The installer that I intend to use will leverage the bash scripts as part of a package management system, so this bash script will actually power the OpenPdroid installer in the Play Store. When we are considering using these scripts as a way to modify running devices...I just want to be real careful. I know that these things are possible, I have done them on my personal devices as of last year. But I have been trying to think of ways to distribute that aren't dangerous, you know? Having an ever-growing test suite is part of that. |
I wouldn't say that this is a test structure...but I am using something similar to what I brought up above while working on an update. This script splits the jar patches into smali patches (split_patch_opd.py) and this erases all errant patches that we don't need for OpenPDroid support (split_opd.sh |
Sorry for the delayed response. I had no real grand plan with how to implement the testing suite, I just searched around for bash/other shell scripting language testing frameworks out of curiosity, as to not reinvent the wheel if we want to get more and more complicated with it. I am not particularly wed to any idea, just want to help you out any way I can. In any event, I need to get back into this. I would probably start by cleaning up some of the code and make it all functions, current issue #116 , and then your main loop calling in all the proper functions and in the right order. Later you could even serialize them with xargs to get speed, optionally. But the bottom line for the functions would be, testing each unit of operation independently, and that would allow to test what you want, and then allow to chain components together without just running the whole auto-patcher process or doing manual steps. Does that make sense? |
I need to add a test suite. When run as a test, it will ignore clean-up and then diff patched and unpatched at minimum.
A test suite would be cool, although i do not know how needed it is here, since we haven't pushed anything truly "broken" in a long time. Bugs in non-linux machines, yes, but I won't be able to craft a test suite for that...
This is just something to think about. Maybe a prep for the play store.
The text was updated successfully, but these errors were encountered: