2018-05-23 11:54:03 +00:00
|
|
|
class Fortio < Formula
|
|
|
|
desc "HTTP and gRPC load testing and visualization tool and server"
|
|
|
|
homepage "https://github.com/istio/fortio"
|
|
|
|
url "https://github.com/istio/fortio.git",
|
2018-08-15 02:31:30 +00:00
|
|
|
:tag => "v1.1.0",
|
|
|
|
:revision => "d13f3b92c63db22136bac4e0896562404bd4ef6e"
|
2018-05-23 11:54:03 +00:00
|
|
|
|
2018-05-23 12:16:28 +00:00
|
|
|
bottle do
|
2018-08-23 19:26:36 +00:00
|
|
|
sha256 "c6e60b4774edcecbb8452175d4b62ee157f2743ffc729c8ac8655d4c314056ab" => :mojave
|
2018-08-15 03:19:04 +00:00
|
|
|
sha256 "9f383a159618023334af96f850ca159115f4be8c52cd9ff0bb752d79fd962ea5" => :high_sierra
|
|
|
|
sha256 "0cae47563c0bf4373858329aae4bb60ae19f6b78ec3d084cc36a36e891a0e01c" => :sierra
|
|
|
|
sha256 "b60701c47ad35b607779a2b2396b6367bb005ccd12b769089cb1ac6d0cff1be0" => :el_capitan
|
2018-05-23 12:16:28 +00:00
|
|
|
end
|
|
|
|
|
2018-05-23 11:54:03 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
|
|
|
(buildpath/"src/istio.io/fortio").install buildpath.children
|
|
|
|
cd "src/istio.io/fortio" do
|
2018-06-28 22:15:20 +00:00
|
|
|
system "make", "official-build", "OFFICIAL_BIN=#{bin}/fortio",
|
|
|
|
"LIB_DIR=#{lib}", "DATA_DIR=."
|
2018-05-23 11:54:03 +00:00
|
|
|
lib.install "ui/static", "ui/templates"
|
|
|
|
prefix.install_metafiles
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match version.to_s, shell_output("#{bin}/fortio version -s")
|
|
|
|
begin
|
|
|
|
pid = fork do
|
|
|
|
exec bin/"fortio", "server", "-http-port", "8080"
|
|
|
|
end
|
|
|
|
sleep 2
|
|
|
|
output = shell_output("#{bin}/fortio load http://localhost:8080/ 2>&1")
|
|
|
|
assert_match /^All\sdone/, output.lines.last
|
|
|
|
ensure
|
|
|
|
Process.kill("SIGTERM", pid)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|