Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

in0rdr
Copy link

@in0rdr in0rdr commented Jan 15, 2025

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Requesting to add latest diary v0.15. Thank you for review.

@github-actions github-actions bot added the new formula PR adds a new formula to Homebrew/homebrew-core label Jan 15, 2025
Copy link
Contributor

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.

@chenrui333 chenrui333 added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Jan 16, 2025
@chenrui333 chenrui333 force-pushed the feat/diary-v0.15 branch 2 times, most recently from 543d7dc to d774f06 Compare January 16, 2025 02:04
@in0rdr
Copy link
Author

in0rdr commented Jan 16, 2025

Thank you for the improvements @chenrui333 much appreciated

Comment on lines 32 to 34
assert_match "", shell_output("DIARY_DIR=na #{bin}/diary", 2)
# Test diary dir option
assert_match "", shell_output("#{bin}/diary -d na", 2)
Copy link
Member

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?

Copy link
Author

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 🙈

Copy link
Author

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

Copy link
Author

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.

@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Jan 17, 2025
diary: assert shell stderr output
diary: improve tests
diary: update deps and livecheck

Signed-off-by: Rui Chen <rui@chenrui.dev>
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. new formula PR adds a new formula to Homebrew/homebrew-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants