Skip to content

Commit

Permalink
citus: fix ENV["CI"] usage.
Browse files Browse the repository at this point in the history
Part of #70493.
  • Loading branch information
MikeMcQuaid committed Feb 8, 2021
1 parent c6f9531 commit 016fe07
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions Formula/citus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,4 @@ def install
include.install Dir["stage/**/include/*"]
(share/"postgresql/extension").install Dir["stage/**/share/postgresql/extension/*"]
end

test do
return if ENV["CI"]

pg_bin = Formula["postgresql"].opt_bin
pg_port = "55561"
system "#{pg_bin}/initdb", testpath/"test"
pid = fork do
exec("#{pg_bin}/postgres",
"-D", testpath/"test",
"-c", "shared_preload_libraries=citus",
"-p", pg_port)
end

begin
sleep 2

count_workers_query = "SELECT COUNT(*) FROM master_get_active_worker_nodes();"

system "#{pg_bin}/createdb", "-p", pg_port, "test"
system "#{pg_bin}/psql", "-p", pg_port, "-d", "test", "--command", "CREATE EXTENSION citus;"

assert_equal "0", shell_output("#{pg_bin}/psql -p #{pg_port} -d test -Atc" \
"'#{count_workers_query}'").strip
ensure
Process.kill 9, pid
Process.wait pid
end
end
end

0 comments on commit 016fe07

Please sign in to comment.