test: use curl --fail

This commit is contained in:
swrup 2026-02-21 23:40:58 +01:00
parent 283ad65a10
commit 9011902554
5 changed files with 17 additions and 7 deletions

View file

@ -41,7 +41,15 @@ let download ~tmp ~url =
let res =
OS.Cmd.run
Cmd.(
v "curl" % "--silent" % "--show-error" % "-o" % tmp % "-X" % "GET" % url)
v "curl"
% "--silent"
% "--show-error"
% "--fail"
% "-o"
% tmp
% "-X"
% "GET"
% url)
in
match res with
| Error (`Msg s) -> Fmt.failwith "download failure: %s" s

View file

@ -158,6 +158,7 @@ let download ~output ~url =
v "curl"
% "--silent"
% "--show-error"
% "--fail"
% "-o"
% output
% "-X"
@ -171,6 +172,8 @@ let upload ~input ~url =
Cmd.(
v "curl"
% "--silent"
% "--show-error"
% "--fail"
% "-i"
% "-X"
% "POST"