-
Notifications
You must be signed in to change notification settings - Fork 46
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
Make some tests more lenient #141
base: master
Are you sure you want to change the base?
Make some tests more lenient #141
Conversation
tput appears to be optional for this plugin, so the tests should not fail if we cannot find tput.
In some exotic packaging environments like Nixpkgs, we enforce heavy amounts of sandboxing; we do not include git by default in that sandbox. Additionally, in said exotic packaging environments, we should not always assume we are in a Git repository. The Nixpkgs GitHub fetcher functions by downloading a tarball, not the whole Git directory, so the test fails.
@@ -6,6 +6,9 @@ | |||
} | |||
|
|||
@test 'ysu version exported' { | |||
(( $+commands[git] )) || skip "git not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I elected to use pure Zsh when checking if a command is present to avoid a dependency on which
.
This increase performance slightly, and also avoids a dependency on which
.
@@ -38,6 +38,8 @@ | |||
} | |||
|
|||
@test 'ysu - _write_ysu_buffer invalid' { | |||
(( $+commands[tput] )) || skip "tput not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one. I would want the CI/CD pipeline to fail if tput
is not installed rather than fail silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's understandable. I can drop the tests: skip tests requiring tput if not present
commit if you prefer. I added this because YSU gracefully handles a missing tput
.
This is part of my work to run unit tests in the Nixpkgs
zsh-you-should-use
package, so that potential breakages are caught early.