Skip to content

Commit 33fb14a

Browse files
committed
update results_file usage for v2
1 parent e2ea2de commit 33fb14a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/jobs-live.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ end
327327
ENV["RESULTS_FILE"] = joinpath(@__DIR__, "output.txt")
328328
n = write(ENV["RESULTS_FILE"], "output-txt-content")
329329
@info "Wrote $(n) bytes"
330+
if haskey(ENV, "JULIAHUB_RESULTS_UPLOAD_DIR")
331+
open(ENV["JULIAHUB_RESULTS_UPLOAD_DIR"], "output.txt") do io
332+
write(io, "output-txt-content")
333+
end
334+
end
330335
"""noenv; alias="output-file"
331336
)
332337
job = JuliaHub.wait_job(job)
@@ -351,8 +356,13 @@ end
351356
# Job output with a tarball:
352357
job, _ = submit_test_job(
353358
JuliaHub.script"""
354-
odir = joinpath(@__DIR__, "output_files")
355-
mkdir(odir)
359+
odir = if haskey(ENV, "JULIAHUB_RESULTS_UPLOAD_DIR")
360+
ENV["JULIAHUB_RESULTS_UPLOAD_DIR"]
361+
else
362+
d = joinpath(@__DIR__, "output_files")
363+
mkdir(d)
364+
d
365+
end
356366
write(joinpath(odir, "foo.txt"), "output-txt-content-1")
357367
write(joinpath(odir, "bar.txt"), "output-txt-content-2")
358368
@info "Wrote: odir"

0 commit comments

Comments
 (0)