-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
introduce bash unit-tests #3741
Comments
GPT-4 says: There isn't a single de facto standard for unit testing shell scripts as the choice often depends on the specific needs of a project, the complexity of the shell scripts, and the preferences of the development team. However, several popular frameworks and tools are commonly used in the industry. Here are a few notable ones:
Each of these tools has its strengths and is suitable for different kinds of projects and preferences. For simpler scripts or projects where Bash is not the primary focus, The best approach is often to evaluate a few of these frameworks based on the specific requirements of your project and choose the one that best fits your needs. |
2 looks interesting to me because we already have TAP-compliant testing elsewhere |
If the tap is generated by suite, it may be disadvantage, as in aqa-tests, the tap files are global. So if the tests would pass, it would be one huge tap file with one test temurin-build passed/failed. Eg I had to disable individual tap files in churn testsuite, becasue it was contraproductive with the main aqa-test tap file, which needed just one tap-file with one test churn, from churn, not details. The https://github.com/rh-openjdk/run-folder-as-tests can speak tap files to. and is really surprising powerful as top level runner. I would agree that With that gone, I would go with run-folder-as-tests and using individual frameworks as sub-suites, generate both tap and xml , and in individual sub suites, use any of the offered frameworks as needed. Tbh, shellspec is to abstract for me. |
hello!
Was there any attempt to include tests at least to temurin-builds?
Looking to #3736 or #3728 are excellent candidates... And I belive in past thre were many simialar pathces introducing standalone single function.
I would vote to use my ancient and favourite:
https://github.com/rh-openjdk/run-folder-as-tests
as it offers ultimate freedom, to to run individual sets, driven by:
https://github.com/lehmannro/assert.sh
https://github.com/kward/shunit2
https://github.com/bmizerany/roundup
https://github.com/sstephenson/bats
https://shellspec.info/
wdyt?
From those, I have strong exepreince only with run-folder-as-tests, but as it can wrap all others, it may be good start.
I have also some experience with shunit2 which works quite well, but (simiarly as assert.sh) I would not use it as standalone solution. I have no experience with bats (which is quite recomended over web, but rep is archived) and with roundup. On roundup (acording to documentation) its sandbox is cool.
But even the run-folder-as-tests is running eah unit as standalone process.
One of the conditionnal steps may be extracting various build.sh, makeAnyJdk.sh, prepareWorkSpace.sh to
build.sh, makeAnyJdk.sh, prepareWorkSpace.sh and buildFunctions.sh, makeAnyJdkFunctions.sh, prepareWorkSpaceFunctions.sh.
The text was updated successfully, but these errors were encountered: