Comments (6)
@larsks what do you think about something like this to get some kind of unit testing for shell scripts?
from risu.
I think some sort of testing for the plugins would be a good idea. I'm not sure about this particular scheme, though, because $COMPONENT
would be hard to specify (that is, if you want to test plugins/pacemaker/stonith_enabled.sh
, what is $COMPONENT
?).
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 plugins/pacemaker/stonith_enabled.sh
, we would look for a directory tests/snapshots/pacemaker/stonith_enabled.sh_pass
, and then run:
docitellus(live=False, path=`tests/snapshots/pacemaker/stonith_enabled.sh_pass`, plugins=[the_plugin])
And then assert
that the plugin result is successful.
How does that sound? I am making this up as I go along, but it seems to offer a fair amount of flexibility.
from risu.
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
from risu.
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.
from risu.
@larsks https://review.gerrithub.io/374645 check that one
from risu.
Merged as separated tests per plugin
from risu.
Related Issues (20)
- Broken link found (https://docs.github.com/en/github/site-policy/github-privacy-statement)
- Broken link found (https://docs.github.com)
- Broken link found (https://docs.github.com)
- Broken link found (https://docs.github.com/en/github/site-policy/github-terms-of-service)
- Broken link found (https://docs.github.com/en/github/site-policy/github-privacy-statement)
- Broken link found (https://docs.github.com) HOT 1
- Broken link found (https://github.com/apps/dependabot) HOT 1
- Broken link found (https://docs.github.com/articles/which-remote-url-should-i-use) HOT 1
- Broken link found (https://docs.github.com) HOT 1
- Broken link found (https://github.com/apps/dependabot)
- Broken link found (https://docs.github.com/articles/which-remote-url-should-i-use)
- Broken link found (https://docs.github.com/en/github/site-policy/github-terms-of-service)
- Broken link found (https://docs.github.com/en/github/site-policy/github-privacy-statement)
- Runtime metadata with local time instead of UTC HOT 7
- Broken link found (https://docs.github.com)
- Broken link found (https://docs.github.com/articles/which-remote-url-should-i-use)
- Broken link found (https://docs.github.com/en/github/site-policy/github-terms-of-service)
- Broken link found (https://docs.github.com/en/github/site-policy/github-privacy-statement)
- Broken link found (https://www.githubstatus.com/)
- Broken link found (https://developer.apple.com/xcode/)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from risu.