Skip to content

Commit 8895f99

Browse files
authored
test: do not write temp file to repo (#102)
1 parent 186d4d3 commit 8895f99

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

test/datasets-large-live.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
@info "Uploading test data with prefix: JuliaHubLargeTest_$(TESTID)"
22
dataset_name = "JuliaHubLargeTest_$(TESTID)_Blob"
33
try
4-
open("testdata/large.dat", "w") do io
4+
lf_ds, lf_filesize = mktemp() do path, io
55
chunk = ones(UInt8, 1024^2)
66
# 210 MB forces multipart upload in rclone
77
for i = 1:210
88
write(io, chunk)
99
end
10+
close(io)
11+
# Upload the file
12+
r = JuliaHub.upload_dataset(
13+
dataset_name, path;
14+
description="some blob", tags=["x", "y", "z"],
15+
auth,
16+
)
17+
r, filesize(path)
1018
end
11-
JuliaHub.upload_dataset(dataset_name,
12-
"testdata/large.dat";
13-
description="some blob", tags=["x", "y", "z"],
14-
auth)
19+
@test lf_ds isa JuliaHub.Dataset
20+
@test lf_ds.name == dataset_name
21+
1522
datasets = JuliaHub.datasets(; auth)
1623
blob_dataset = only(filter(d -> d.name == dataset_name, datasets))
17-
@test blob_dataset.size == filesize("testdata/large.dat")
24+
@test blob_dataset.size == lf_filesize
1825
finally
1926
try
2027
JuliaHub.delete_dataset(dataset_name; auth)

0 commit comments

Comments
 (0)