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

libcdio-paranoia: 10.2+2.0.1 (new formula) #114860

Closed
wants to merge 1 commit into from

Conversation

minmaxmean
Copy link

libcdio-paranoia is a port of cdda paranoia, which uses libcdio for CDROM access.

I know that my current test is not preferred, but I'm not sure how I should properly check this formula.

  • 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 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 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

libcdio-paranoia is a port of cdda paranoia, which uses libcdio for
CDROM access
@BrewTestBot BrewTestBot added the new formula PR adds a new formula to Homebrew/homebrew-core label Nov 6, 2022
@chenrui333 chenrui333 changed the title libcdio-paranoia: 10.2+2.0.1 libcdio-paranoia: 10.2+2.0.1 (new formula) Nov 6, 2022
end

test do
assert_match(/cdparanoia/, shell_output("#{bin}/cd-paranoia -V 2>&1").partition(" ").first)
Copy link
Member

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.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale No recent activity label Nov 27, 2022
@github-actions github-actions bot closed this Dec 4, 2022
@github-actions github-actions bot added the outdated PR was locked due to age label Jan 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2023
@chenrui333
Copy link
Member

#204300

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new formula PR adds a new formula to Homebrew/homebrew-core outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants