-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
diary 0.15 (new formula) #204366
base: master
Are you sure you want to change the base?
diary 0.15 (new formula) #204366
Conversation
Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request. |
76f01cb
to
bcbde2a
Compare
543d7dc
to
d774f06
Compare
d774f06
to
dcac605
Compare
Thank you for the improvements @chenrui333 much appreciated |
dcac605
to
af2e7f7
Compare
Formula/d/diary.rb
Outdated
assert_match "", shell_output("DIARY_DIR=na #{bin}/diary", 2) | ||
# Test diary dir option | ||
assert_match "", shell_output("#{bin}/diary -d na", 2) |
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.
Since these matches are regexes this will match anything. What is the expected output?
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.
The expected output is defined here:
The expected result code is 2 or 1 (for error). The error is written to stderr.
Can you help me with catching the shell output properly? When I try to use the actual error message in the assertion, I get an error.
For example, when I test like this:
assert_match "The directory 'na' does not exist", shell_output("DIARY_DIR=na #{bin}/diary", 2)
I get the following message for brew test diary
:
An exception occurred within a child process:
Minitest::Assertion: Expected /The\ directory\ 'na'\ does\ not\ exist/ to match "".
Could it be, that I need to add a special flag to assert_match
or shell_output
which allows me to check the message on stderr (not stdout)? Sorry, I'm new to this 🙈
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.
Uhff, I think I found the "hack":
This works, let me update the code for you
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.
@SMillerDev can we add this note on how to check stderr with shell_output
to the Formula Cookbook? I assume it's helpful for new users like me.
diary: assert shell stderr output diary: improve tests diary: update deps and livecheck Signed-off-by: Rui Chen <rui@chenrui.dev>
3636f4a
to
6757fba
Compare
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?Requesting to add latest diary v0.15. Thank you for review.