-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Posix sh #237
base: master
Are you sure you want to change the base?
Posix sh #237
Conversation
@grayed Vadim welcome back! I'm very very (very) glad to see you again. Thank you very much for the fixes (have you run the tests?), |
Nope, I've totally missed the fact that tests exist. Is there any reason to not run them in GitHub CI? If not, will you accept a PR that adds appropriate GitHub actions then? |
Here are results of running tests on OpenBSD: https://gist.github.com/grayed/4257f05f399df44753a3619ce7d18101 Before tweaks from the PR there was no success at all, BTW, due to broken arguments passing. The results vary from run to run, sometimes there are 9 successfull tests, sometimes 8. I didn't dig into them, though, since there is too much Python for me now. :-\ |
You didn't guess! This crazy test (and it is actually, just one test, but with several test cases) is written in bash. Regarding your question, why the test is not running in CI, |
Well, the tests are run by shell script, yes, but they try to run Python code, and it looks like something doesn't work there well. Still do not have enough time to look throughly. :( I've sent another PR, with GitHub action draft, maybe it'll help. :) |
$Thank you for the fixes; actually we have CI, and eactly these tests are running there (we use travis-ci), |
Well, this needs to be rebased to become mergeable. :D |
…erly handle CHTSH environment variable, which override default CHTSH_HOME path
This should fix current build failure with timeout https://travis-ci.org/github/chubin/cheat.sh/builds/741308362#L402
`--connect-timeout` didn't work, because Docker allows it, but breaks, because nothing is listening on the other side, giving this error. $ curl --connect-timeout 10 http://localhost:8002 curl: (56) Recv failure: Connection reset by peer The command "curl --connect-timeout 10 http://localhost:8002" exited with 56. https://travis-ci.org/github/chubin/cheat.sh/builds/741348053#L401 `--retry-all` makes `curl` retry on all errors, including connection resets.
Because even Ubuntu 20.04 version of `curl` is outdated
Because at least live reloading doesn't seem to work with `gevent`
Co-authored-by: Anatoli Babenia <[email protected]>
…hlorenz/doctoc The documentation was so nice, I couldn't help but adding a toc.
CHEATSH_UPDATE_TESTS_RESULTS=YES bash run-tests.sh
`colored` became smarter in patch version to avoid coloring if running without TTY https://gitlab.com/dslackw/colored/-/issues/21
A followup to chubin#312
This replaces cycle logic in chubin#312 with regex.
Temporary fix until this is merged https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/27419
`universal_newlines` make this in compatible way with older Python.
The portability fans are back! :-)
There were a few things broken already. In particular, a few places had "$foo" instead of $foo, breaking the intended words expansion.
The bash arrays were replaced with either simple expansion, or written directly, resulting in no code quality loss.
The zsh bits are only needed if someone will ever run "zsh cht.sh" and could be dropped; when zsh is working as sh, the shwordsplit option gets set automatically.
The local/typeset/declare case is the most complicated one. Technically, POSIX just reserves "local", "typeset" and "declare" for use by shell, keeping them as undefined behavior. All the shells I've tested with (bash, dash, ksh93, OpenBSD ksh, zsh) support either "local" or "typeset" command. But for better compatibility sakeness, since it was meaningful enough for 884161c, the "eval" fallback was implemented. This makes "local foo" invalid, thought, so I had to replace all of them with "local foo=" instead. But the better option likely be just ignoring shells that do not support local-scoped variables, since the code is likely to break in this case anyway.