2 desc "Cross-language distributed transaction manager"
3 homepage "https://en.dtm.pub/"
4 url "https://github.com/dtm-labs/dtm/archive/refs/tags/v1.19.0.tar.gz"
5 sha256 "11340c32e810dfd463953bca0a5f5a2c41a88c35782efc2ab70cfa78733fa823"
9 sha256 cellar: :any_skip_relocation, arm64_sequoia: "818718052e97df9ffcfed8c29a8f7bbce0e5302c6639c208c3c080d188ce75c6"
10 sha256 cellar: :any_skip_relocation, arm64_sonoma: "818718052e97df9ffcfed8c29a8f7bbce0e5302c6639c208c3c080d188ce75c6"
11 sha256 cellar: :any_skip_relocation, arm64_ventura: "818718052e97df9ffcfed8c29a8f7bbce0e5302c6639c208c3c080d188ce75c6"
12 sha256 cellar: :any_skip_relocation, sonoma: "cb8953792e5ca9d7edd4f56547f3f333ff6bb34de276f60781edd57acedc1288"
13 sha256 cellar: :any_skip_relocation, ventura: "cb8953792e5ca9d7edd4f56547f3f333ff6bb34de276f60781edd57acedc1288"
14 sha256 cellar: :any_skip_relocation, x86_64_linux: "a2def5327f55d8f789fa34bbe6ad73606bbe2807d42a59026f04130456fac0cb"
17 depends_on "go" => :build
20 system "go", "build", *std_go_args(ldflags: "-s -w -X main.Version=v#{version}")
21 system "go", "build", *std_go_args(ldflags: "-s -w", output: bin/"dtm-qs"), "qs/main.go"
25 assert_match "dtm version: v#{version}", shell_output("#{bin}/dtm -v")
31 ENV["HTTP_PORT"] = http_port.to_s
32 ENV["GRPC_PORT"] = grpc_port.to_s
35 # sleep to let dtm get its wits about it
37 metrics_output = shell_output("curl -s localhost:#{http_port}/api/metrics")
38 assert_match "# HELP dtm_server_info The information of this dtm server.", metrics_output
40 all_json = JSON.parse(shell_output("curl -s localhost:#{http_port}/api/dtmsvr/all"))
41 assert_equal 0, all_json["next_position"].length
42 assert all_json["next_position"].instance_of? String
43 assert_equal 0, all_json["transactions"].length
44 assert all_json["transactions"].instance_of? Array
46 # clean up the dtm process before we leave
47 Process.kill("HUP", dtm_pid)