@@ -2,18 +2,18 @@ class Heartbeat < Formula
22 desc "Lightweight Shipper for Uptime Monitoring"
33 homepage "https://www.elastic.co/beats/heartbeat"
44 url "https://github.com/elastic/beats.git" ,
5- tag : "v8.16.1 " ,
6- revision : "f17e0828f1de9f1a256d3f520324fa6da53daee5 "
5+ tag : "v8.17.0 " ,
6+ revision : "092f0eae4d0d343cc3a142f671c2a0428df67840 "
77 license "Apache-2.0"
88 head "https://github.com/elastic/beats.git" , branch : "master"
99
1010 bottle do
11- sha256 cellar : :any_skip_relocation , arm64_sequoia : "93e49e150068211d119d50cbdb2e3255577baab17aca54dc5d90a3d09d4a2a44 "
12- sha256 cellar : :any_skip_relocation , arm64_sonoma : "9d525150a84d361b47e95bce1e1b500369123d3308dd7afdc3e2b65159efac62 "
13- sha256 cellar : :any_skip_relocation , arm64_ventura : "3c5a05d73598c196ea751f4deddd2516c4aabed14817d3f2dc3f5f5194cb7a2e "
14- sha256 cellar : :any_skip_relocation , sonoma : "547a9c35882c778f90064e17503aabbbd2505659fa977e48e6944e0c93771b2c "
15- sha256 cellar : :any_skip_relocation , ventura : "0dc43ab97b35d318e45dba69da2da09227ce859ddd812d08bb451fd81f5406e0 "
16- sha256 cellar : :any_skip_relocation , x86_64_linux : "babda51cefce2ae2039118dd801c9b457f634163a548bd2d8be6c4afead07cfe "
11+ sha256 cellar : :any_skip_relocation , arm64_sequoia : "b8e753ec2d5880405874e61abb16bf6e5e87487f3a258221c1970958b4505e8e "
12+ sha256 cellar : :any_skip_relocation , arm64_sonoma : "ef5c6cf2eab88ef9df06a4ef21a033622773509d7b7df3f41eef9661cce84d6a "
13+ sha256 cellar : :any_skip_relocation , arm64_ventura : "c5435c9222244b883d9fce1585f92917b1f180873d6796ee1d326dab2ea538dc "
14+ sha256 cellar : :any_skip_relocation , sonoma : "0011afb9fc0674b9228e06670797ec9dd900aff9afc7b6b8e7db00f90bdd27d5 "
15+ sha256 cellar : :any_skip_relocation , ventura : "5a7b3d88df68366869d274e04a0d402e56c3b5473d8ceaea2b457faed6fde483 "
16+ sha256 cellar : :any_skip_relocation , x86_64_linux : "5f25e3043fb84fb08e390055bdb44ed2c6efd7d0899affe519b8edcb47158e20 "
1717 end
1818
1919 depends_on "go" => :build
@@ -65,35 +65,39 @@ def post_install
6565 # https://github.com/Homebrew/homebrew-core/pull/91712
6666 return if OS . linux? && ENV [ "HOMEBREW_GITHUB_ACTIONS" ] . present?
6767
68- port = free_port
69-
70- ( testpath /"config/heartbeat.yml" ) . write <<~YAML
71- heartbeat.monitors:
72- - type: tcp
73- schedule: '@every 5s'
74- hosts: ["localhost:#{ port } "]
75- check.send: "hello\\ n"
76- check.receive: "goodbye\\ n"
77- output.file:
78- path: "#{ testpath } /heartbeat"
79- filename: heartbeat
80- codec.format:
81- string: '%{[monitor]}'
82- YAML
83- fork do
84- exec bin /"heartbeat" , "-path.config" , testpath /"config" , "-path.data" ,
85- testpath /"data"
86- end
87- sleep 5
88- assert_match "hello" , pipe_output ( "nc -l #{ port } " , "goodbye\n " , 0 )
68+ begin
69+ port = free_port
70+
71+ ( testpath /"config/heartbeat.yml" ) . write <<~YAML
72+ heartbeat.monitors:
73+ - type: tcp
74+ schedule: '@every 5s'
75+ hosts: ["localhost:#{ port } "]
76+ check.send: "hello\\ n"
77+ check.receive: "goodbye\\ n"
78+ output.file:
79+ path: "#{ testpath } /heartbeat"
80+ filename: heartbeat
81+ codec.format:
82+ string: '%{[monitor]}'
83+ YAML
84+
85+ pid = spawn bin /"heartbeat" , "--path.config" , testpath /"config" , "--path.data" , testpath /"data"
86+ sleep 5
87+ sleep 5 if OS . mac? && Hardware ::CPU . intel?
88+ assert_match "hello" , pipe_output ( "nc -l #{ port } " , "goodbye\n " , 0 )
89+ sleep 5
8990
90- sleep 5
91- output = JSON . parse ( ( testpath /"data/meta.json" ) . read )
92- assert_includes output , "first_start"
91+ output = JSON . parse ( ( testpath /"data/meta.json" ) . read )
92+ assert_includes output , "first_start"
9393
94- ( testpath /"data" ) . glob ( "heartbeat-*.ndjson" ) do |file |
95- s = JSON . parse ( file . read )
96- assert_match "up" , s [ "status" ]
94+ ( testpath /"data" ) . glob ( "heartbeat-*.ndjson" ) do |file |
95+ s = JSON . parse ( file . read )
96+ assert_match "up" , s [ "status" ]
97+ end
98+ ensure
99+ Process . kill ( "TERM" , pid )
100+ Process . wait ( pid )
97101 end
98102 end
99103end
0 commit comments