summaryrefslogtreecommitdiff
path: root/bin/test
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-30 12:40:38 -0600
committermo khan <mo@mokhan.ca>2025-05-30 12:40:38 -0600
commit463c259bd41f20d5811b028e8045f3de3effe097 (patch)
treef669fa26ccbb4e46c146fcb924d093ce8b9bb4a4 /bin/test
parentf59105ea06171e090b22b37f74d861ccd781a6ed (diff)
feat: parse BIND_ADDR env variable
Diffstat (limited to 'bin/test')
-rwxr-xr-xbin/test11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/test b/bin/test
index 79fe939..be8878b 100755
--- a/bin/test
+++ b/bin/test
@@ -9,10 +9,15 @@ gemfile do
gem "net-hippie", "~> 1.0"
end
-pid = Process.spawn("mise exec -- cargo run")
+$bind_addr = ENV.fetch("BIND_ADDR", "127.0.0.1:7878")
+
+pid = Process.spawn({
+ "BIND_ADDR" => $bind_addr
+}, "mise exec -- cargo run")
sleep 1
at_exit do
+ Process.kill('SIGTERM', pid)
system("killall sts")
end
@@ -22,7 +27,7 @@ class ServerTest < Minitest::Test
attr_reader :base_url, :client
def setup
- @base_url = "http://127.0.0.1:7878"
+ @base_url = "http://#{$bind_addr}"
@client = Net::Hippie::Client.new
end
@@ -40,7 +45,7 @@ class ServerTest < Minitest::Test
def test_metadata
response = client.get(base_url + "/.well-known/oauth-authorization-server")
assert_equal "200", response.code
- # assert_equal "application/json", response["Content-Type"]
+ assert_equal "application/json", response["Content-Type"]
end
# /token - Token endpoint https://datatracker.ietf.org/doc/html/rfc8693#section-2.3