class Sonobuoy < Formula desc "Kubernetes component that generates reports on cluster conformance" homepage "https://github.com/heptio/sonobuoy" url "https://github.com/heptio/sonobuoy/archive/v0.16.0.tar.gz" sha256 "eea06fd8c87a5193dec0e82310fbb33739247e31509733e874f6dc082e0bea70" bottle do cellar :any_skip_relocation sha256 "f55355ef20bc57cb0da1e3d7b6ce69984e0776bf8ee1206c8e0fc96f3f7e1489" => :catalina sha256 "1a02e4a62cd9ee2f27adf2a0db470bb1a2119ba9c2fc498aac7e9abfea652a77" => :mojave sha256 "b6122bdbee3bece94a2b3e6d1cc96436d1e53b384427880a5d10374c5ed05231" => :high_sierra end depends_on "go" => :build resource "sonobuoyresults" do url "https://raw.githubusercontent.com/heptio/sonobuoy/master/pkg/client/results/testdata/results-0.10.tar.gz" sha256 "a945ba4d475e33820310a6138e3744f301a442ba01977d38f2b635d2e6f24684" end def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/heptio/sonobuoy").install buildpath.children cd "src/github.com/heptio/sonobuoy" do system "go", "build", "-o", bin/"sonobuoy", "-installsuffix", "static", "-ldflags", "-s -w -X github.com/heptio/sonobuoy/pkg/buildinfo.Version=#{version}", "./" prefix.install_metafiles end end test do output = shell_output("#{bin}/sonobuoy 2>&1") assert_match "Sonobuoy is an introspective kubernetes component that generates reports on cluster conformance", output assert_match version.to_s, shell_output("#{bin}/sonobuoy version 2>&1") output = shell_output("#{bin}/sonobuoy gen --kube-conformance-image-version=v1.14 2>&1") assert_match "name: sonobuoy", output output = shell_output("#{bin}/sonobuoy e2e --show=all " + resource("sonobuoyresults").cached_download + " 2>&1") assert_match "all tests", output end end