-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
zssh: re-run autoreconf #66397
zssh: re-run autoreconf #66397
Conversation
OK my new
I guess they don't like running without a pty (even to print |
Formula/zssh.rb
Outdated
test do | ||
system "#{bin}/zssh", "--version" | ||
system "#{bin}/ztelnet", "--version" | ||
end |
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.
We need a test that exercises the some of the functionality of the app. Version checks or usage checks (foo --version or foo --help) are not sufficient, as explained in the formula cookbook.
In most cases, a good test would involve running a simple test case: run #{bin}/foo input.txt.
- Then you can check that the output is as expected (with assert_equal or assert_match on the output of shell_output)
- You can also check that an output file was created, if that is expected: assert_predicate testpath/"output.txt", :exist?
Some advice for specific cases:
- If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
- If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.
- If the software cannot function without credentials, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected.
- Same if the software requires a virtual machine, docker instance, etc. to be running.
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 am aware that just tests running --version
are not great, although they are very common in Homebrew. At least they are verify that the compile generated a runnable binary.
As I've said elsewhere, I am just trying to help out fixing bottling issues on Big Sur. I've never used this particular package and have no idea how to test it more in-depth; I am just trying to make it build again.
Anyway I'll remove this test and we'll just leave this formula test-less as it was before. It was just an attempt at a slight improvement while I was fixing something else.
Try passing your test through Given that the package is designed for "interactive file transfers over SSH", not sure how much more substantial a test one can write. Of course, maybe I'm just not familiar enough with Homebrew's test infrastructure. Anyway, this might be helpful: https://docs.brew.sh/Formula-Cookbook#add-a-test-to-the-formula |
An MVT (Minimum Viable Test) might be to connect to a free port on localhost and match the output against an expected error message. |
Doubt that works. It seems that
so unless there is a way to make the test infra allocate a pty, it probably isn't work persuing further. Anyway, like I said I'm just going to remove this attempt to add a basic test to this PR and just concentrate on the changes needed to make Big Sur build OK. If there's anything this experience has taught me is that adding a testcase in a PRjust invites nitpicking it to death. I'm just going to concentrate purely on the Big Sur stuff and leave testing be. |
a41e50d
to
0d2d25c
Compare
You might call it nitpicking, but adding a real test that works helps make the next OS update less of a pain. |
0d2d25c
to
ef1c1c9
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The ./configure file included in the 1.5c tarball is too old to work with Xcode 12.
ef1c1c9
to
478de12
Compare
The
./configure
file included in the 1.5c tarball is too old to work with Xcode 12.