From c856388e186b0c8d21ae12be1bfa59117112ab7a Mon Sep 17 00:00:00 2001 From: tan Date: Mon, 10 Nov 2025 18:11:28 +0530 Subject: [PATCH] fix(test,doc): port env name change Older JuliaHub jobimage environments used `PORT` as the environment variable name. This was updated to `JULIAHUB_APP_PORT` in newer (v2) jobimage environment. This updates the tests to check both. Also updates the example in the docs. --- docs/src/guides/jobs.md | 4 +++- test/jobenvs/job-exposed-port/server.jl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/guides/jobs.md b/docs/src/guides/jobs.md index 60646c33c..56fdd147a 100644 --- a/docs/src/guides/jobs.md +++ b/docs/src/guides/jobs.md @@ -253,7 +253,9 @@ import JuliaHub # hide job = JuliaHub.submit_job( JuliaHub.script""" using Oxygen, HTTP - PORT = parse(Int, ENV["PORT"]) + # Environment variable name `PORT` was used in older JuliaHub environments + # and has been replaced with `JULIAHUB_APP_PORT` in newer environments + PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"])) @get "/" function(req::HTTP.Request) return "success" end diff --git a/test/jobenvs/job-exposed-port/server.jl b/test/jobenvs/job-exposed-port/server.jl index d4d20836d..6c0186594 100644 --- a/test/jobenvs/job-exposed-port/server.jl +++ b/test/jobenvs/job-exposed-port/server.jl @@ -1,6 +1,8 @@ using Oxygen, HTTP -const PORT = parse(Int, ENV["PORT"]) +# Environment variable name `PORT` was used in older JuliaHub environments +# and has been replaced with `JULIAHUB_APP_PORT` in newer environments +const PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"])) const NREQUESTS = Ref{Int}(0) function results_json()