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

lume 0.1.6 (new formula) #206942

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

lume 0.1.6 (new formula) #206942

wants to merge 1 commit into from

Conversation

unitof
Copy link
Contributor

@unitof unitof commented Feb 8, 2025

Need to write a good test then confirm everything is working.

Test should do more than print version: https://github.com/trycua/homebrew-lume/blob/main/Formula/lume.rb

Gotta run to another project now but pushing so work doesn't conflict with someone else. Feel free to contribute though! I'm slow but love learning by writing Homebrew formulae.

  • 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>?

@github-actions github-actions bot added new formula PR adds a new formula to Homebrew/homebrew-core swift Swift use is a significant feature of the PR or issue macos-only Formula depends on macOS labels Feb 8, 2025
@chenrui333 chenrui333 changed the title lume (new formula) lume 0.1.6 (new formula) Feb 8, 2025
@github-actions github-actions bot added the automerge-skip `brew pr-automerge` will skip this pull request label Feb 8, 2025
@unitof
Copy link
Contributor Author

unitof commented Feb 8, 2025

I'd love the test to actually pull and run an image but the current smallest (Ubuntu) on the default registry is 20GB.

Seems excessive for a test. Or legitimate considering what this app does (pull and run prebuilt VMs).

Could use some guidance.

Meanwhile, made the test just do a different command which confirms installation (get the current machine's latest IPSW image URL).

@unitof unitof marked this pull request as ready for review February 8, 2025 05:44
@gromgit
Copy link
Contributor

gromgit commented Feb 8, 2025

In general, I think tests that catch expected failures are also OK, as long as they exercise non-trivial parts of the code (printing a version number or help text is as trivial as it gets).

For instance, see #206363 (full disclosure: that was my PR). The version check was to verify that the manual version setting in the install block actually happened (this Is fairly common amongst Go formulae), but the real "meat" is the "terminal not cursor addressable" test, because the test block is run with TERM=dumb but lazysql is an SQL TUI.

@gromgit
Copy link
Contributor

gromgit commented Feb 8, 2025

Strangely, my view of your PR looks like this:

image image

so I can't make any concrete suggestions.

@unitof
Copy link
Contributor Author

unitof commented Feb 8, 2025

Yeah…I'm realizing the same. Playing with a new Git client (Working Copy) and seems to have messed up the amend. Please hold!

@github-actions github-actions bot removed the automerge-skip `brew pr-automerge` will skip this pull request label Feb 8, 2025
Formula/l/lume.rb Outdated Show resolved Hide resolved
Formula/l/lume.rb Outdated Show resolved Hide resolved
@unitof unitof force-pushed the add-lume branch 3 times, most recently from 6c5ffcc to f898676 Compare February 9, 2025 21:11
@unitof
Copy link
Contributor Author

unitof commented Feb 9, 2025

Would appreciate an exception to GitHub repository too new (<30 days old) from maintainers.

@chenrui333 chenrui333 added audit failure CI fails while auditing the software CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-skip-new-formulae Pass --skip-new to brew test-bot. and removed audit failure CI fails while auditing the software labels Feb 11, 2025
@unitof unitof force-pushed the add-lume branch 3 times, most recently from 247f830 to b1012ef Compare February 11, 2025 21:56
@unitof
Copy link
Contributor Author

unitof commented Feb 11, 2025

The '%{http_code}' is a string arg for curl for the test stanza. How can I annotated it correctly so it doesn't trigger Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).?

@alebcay
Copy link
Member

alebcay commented Feb 15, 2025

I don't have a good answer for allowing the exact use of %{http_code}, but you could consider a slightly different curl invocation, e.g. curl -sI localhost:#{port}/lume, and then check the first line of the output, e.g.:

assert_match /HTTP.*\w+[200|404]/, shell_output("curl -sI localhost:#{port}/lume").lines.first

(-I uses the HTTP HEAD method; if it is crucial to use GET instead, -I can be replaced with -i instead, it will just produce and discard more output.)

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. CI-skip-new-formulae Pass --skip-new to brew test-bot. macos-only Formula depends on macOS new formula PR adds a new formula to Homebrew/homebrew-core swift Swift use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants