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

pter 3.8.0 (new formula) #146124

Merged
merged 2 commits into from Sep 29, 2023
Merged

pter 3.8.0 (new formula) #146124

merged 2 commits into from Sep 29, 2023

Conversation

BuonOmo
Copy link
Contributor

@BuonOmo BuonOmo commented Sep 26, 2023

  • 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 python Python use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core labels Sep 26, 2023
@BuonOmo BuonOmo mentioned this pull request Sep 26, 2023
end

test do
assert_equal "pter #{version}", shell_output("#{bin}/pter --version").strip
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, hope it is good ! I think you could mention expect and PTY for the GUI testing part in this advice. Otherwise we're not really testing the main tool!

Sorry that I missed that part in the cookbook. I was looking at how other were tested and saw that most ncurse based library use version or help hooks ^^

@BuonOmo
Copy link
Contributor Author

BuonOmo commented Sep 27, 2023

@SMillerDev it should be all good now :)

@chenrui333
Copy link
Member

@BuonOmo, thanks for your contribution to homebrew-core! 🎉

@github-actions
Copy link
Contributor

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Sep 29, 2023
@BrewTestBot BrewTestBot added this pull request to the merge queue Sep 29, 2023
Merged via the queue into Homebrew:master with commit a4c2796 Sep 29, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. new formula PR adds a new formula to Homebrew/homebrew-core python Python use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants