-
Notifications
You must be signed in to change notification settings - Fork 35
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
Write a python wrapper for Shell files unit testing #83
Comments
@larsks what do you think about something like this to get some kind of unit testing for shell scripts? |
I think some sort of testing for the plugins would be a good idea. I'm not sure about this particular scheme, though, because An alternative would be to have the test look for a directory named after the plugin, and use that as the filesystem snapshot for testing the plugin. For example, for testing
And then How does that sound? I am making this up as I go along, but it seems to offer a fair amount of flexibility. |
My idea was to write 'test_pacemaker_fail.sh so it precreates required files so the .sh file fails (actual test) and use 'pacemaker' as filter for the plugins to use The second approach is also good, but puts more 'data' in the git repo while the other, creates it on the fly |
Well, you have the same data in both cases. In my case it lives on disk in files where it can be used as is, while in your example it lives in the scripts and is written out for each test run. I guess implement a couple of tests and see how things work out. |
@larsks https://review.gerrithub.io/374645 check that one |
Merged as separated tests per plugin |
Write a wrapper plugin in tests/ that can search for .sh tests with patterns:
test_$COMPONENT_fail.sh
test_$COMPONENT_pass.sh
test_$COMPONENT_skip.sh
that take care of creating fake files in a fake folder that is passed to citellus for checking that results are expected ones
The text was updated successfully, but these errors were encountered: