-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enable tests for zsh, yash, mksh and ksh93u+m #2
Conversation
@9ao9ai9ar this is my first time testing on a real GitHub instance, unfortunately the behavior seems to differ from the tool I've been using for local tests (i.e., act). Please give me some time to adjust a few things before merging. |
No worries, I don't even know how to run and write for these tools, so I leave that all to you. Take your time. |
Hi @aartoni, the scripts have been substantially updated since you opened this pull request. Are you interested in adding more runners to the workflow? The Re how the scripts are tested, I am not sure if you should go so far as to test the exact exit status (just a =0 or >0 test is enough in my opinion), but if you do, it's probably more readable and less prone to breakage if you use the defined names for the exit status, which you could obtain like thus: (. ./updater.sh 2>/dev/null && exit_status_definitions >./status_codes.txt) &&
eval "$(cat ./status_codes.txt)" And to use them: if [ "$?" -eq "${_EX_OK:?}" ]; then
# test logic
fi There are also some behaviors you could tweak by setting certain environment variables (see the example advanced usage near the top of the files):
Basically all the variables in all caps that do not start with an underscore are open to the users for tweaking. |
@9ao9ai9ar thank you for pinging me! I've added tests for mksh and ksh93u+m, this week I'd like to keep making small contributions until we reach a good state. For now, I've adopted your suggestion regarding env vars, although I didn't use |
Hey @9ao9ai9ar! We're almost ready for merging here, here's the list of things I want to finish before merging:
And here's a list of things I'd like to defer to another PR (after we merge yours into Arkenfox's):
|
In the meantime, can I ask you to synchronize your branches with the latest edits from the upstream? Thanks in advance! |
I'm wondering how would you test it on Windows? I'm not going down that rabbit hole by way of WSL, Cygwin or MSYS2, etc., but you're free to try. For the last test, you may:
Please refer to the updated, topmost post at arkenfox#1908 for the support status of POSIX compliant shells: hush is not targeted, and I'm debating whether ksh88-based shells like pdksh and XPG4 sh should be targeted at all since they are crippled; likewise with bosh, which I'm still studying. Tests for BusyBox ash and posh could be added as they're in the official APT repositories and have more users. You don't have to go overboard with automated test coverage since shells are just part of the equation: it's always better to test in the target OS directly, but since it's Microsoft's GitHub, they will make this hard for you. |
Forgot to mention that you could install the Do you mind if I do some editing before merging this? Also, I would like to turn this into manual run to be more environment friendly: most commits or pull requests will not be touching these shell scripts. |
Windows might not be that hard thanks to the fact that the windows-latest image already includes bash.
These are all good alternative, we're using
I'd say it's better if we remove the
I'll be adding ash in a few mins, thanks!
Thanks for pointing that out! I've pushed the suggested change!
I don't mind at all! |
@9ao9ai9ar |
There are currently one
I will merge your PR and make the necessary changes sometime this week. |
Hey @aartoni I just reworked the GitHub workflow and understood why you wanted me to synchronize my branches with the latest edits from the upstream - so that your last test with the diff could pass. I've removed that test since it requires constant synchronization with the upstream and therefore is brittle. I've also run the tests using a Windows runner, but unfortunately the runner only supports Git Bash and WSL 1, and Git Bash doesn't include a Among the shells in your TODO, I've already added posh; ksh88 is superseded by mksh/oksh and it makes little sense to test this obsolescent shell in isolation without the whole OSes that still ship it and the accompanying userland utilities; I don't think official precompiled binaries or docker images for osh and bosh exist, and compiling them from source is an ongoing maintenance overhead due to changing dependencies, so I'm fine with leaving them out of the test. |
Hey @9ao9ai9ar thank you for taking over while I was away! I will have a look at the current state in the upcoming weeks |
No description provided.