Commit graph

18 commits

Author SHA1 Message Date
Mislav Marohnić
93c50bbaf0
Show progress of downloaded files in the terminal
This connects the stderr of download utilities like curl and wget to the
original stderr of the process so that they can detect a terminal and
print progress bars to it.
2023-11-07 10:17:54 +01:00
Yamashita, Yuu
34652a4fae Allow overriding HTTP client type based on environment variable RUBY_BUILD_HTTP_CLIENT (pyenv/pyenv#1126) 2018-04-26 02:08:59 +00:00
Jason Karns
21494ba359 Remove suite-wide setup
Bats doesn't support both suite-wide setup (in helper) *and* file-wide
setup. Which means the existance of any file-level setup() function
overwrites any setup() function from test_helper. This can be confusing,
and (IMO) easier to simply avoid the overwriting and remove any
_implied_ suite-wide setup function from test_helper.

This turns out to not be so bad for the recently added setup function,
because the only test files that actually need aria2c removed from PATH
are those that actually invoke curl. These can be found because they are
the only test files that stub curl; half of which already had
file-specific setup() functions. So the only ones which need a
file-local setup() function added were: checksum.bats and mirror.bats

Along these lines, rbenv.bats and hooks.bats were removing aria2c from
PATH but don't actually need to. (curl isn't stubbed in these tests so
the existance of aria2c wouldn't affect the tests)

Lastly, fixed a tab/spaces whitespace mixup that was introduced by:
750c086d11
2016-08-13 15:53:04 -04:00
Yamashita, Yuu
b3ba8c8666 Use curl stub during tests by default 2016-06-10 05:11:26 +00:00
Yamashita, Yuu
e56f6cf82d aria2c doesn't support writing remote content to stdout (yyuu/pyenv#619, yyuu/pyenv#620) 2016-06-02 01:58:02 +00:00
Yamashita, Yuu
f998f10597 Allow specifying custom command line options for aria2c, curl and wget 2016-02-13 03:51:31 +00:00
Yamashita, Yuu
54286dcb7e Use aria2c the "ultra fast" download utility if available 2016-02-13 03:43:25 +00:00
Jason Karns
84b49768b9 Add refute test helper 2016-01-20 10:43:46 -05:00
Jason Karns
8f86b59a34 Leverage assertion helpers in tests 2016-01-20 09:30:57 -05:00
Jason Karns
af49837c12 Helpful error msg for unexpected checksum length 2016-01-19 08:24:28 -05:00
Jason Karns
14750a0b93 Extract has_checksum_support predicate function
- Remove unnecessary HAS_X_SUPPORT variables
- Merge conditional for unsetting mirror-url
- Memoize has_checksum_support function
2016-01-18 23:27:01 -05:00
Jason Karns
9ff6402e43 Leverage assert_success helper
And separate test body into arrange-act-assert blocks via newlines
2016-01-18 11:49:59 -05:00
Thomas Johansen
b4154d11e8 Re-introduce legacy MD5 checksum verification based on checksum length
This is so any 3rd-party definitions continue to work even if they have
MD5 checksums embedded.
2014-05-23 14:39:41 +07:00
Thomas Johansen
fb5e2b1ae6 Replace MD5 commands with SHA2 equivalents
A more secure hashing algorithm makes it less feasible to serve up a
modified tarball that matches the same checksum.

See the discussion in #548
2014-05-23 14:34:37 +07:00
Mislav Marohnić
1bcd249ffa Avoid re-downloading if there's a valid tarball in build location
If there already exists a valid tarball in the build location, e.g. as
artefact of a previous install using `--keep`, don't re-download the
file, as there is no need.

References #487
2014-03-25 04:15:50 +01:00
Mislav Marohnić
a3009b4641 Fix re-downloading tarball when destination file already exists
Previously, curl and wget were instructed to try to resume the download
if the destination file already exists. This is supposed to be done via
the "Range" HTTP header, but doesn't work well with CloudFront:

    HTTP server doesn't seem to support byte ranges. Cannot resume.

CloudFront is supposed to support ranges, so I don't know what's going
on here. It might be failing only in case the existing file is a fully
downloaded tarball?

In any case, this disables resuming downloads and resorts to simply
re-downloading the tarball always, overwriting the existing file.

Fixes #487
2014-03-25 03:21:27 +01:00
Mislav Marohnić
a9a274e624 Fix broken test suite
Fixes breakage caused by curl arguments change in
d0912e4fb5
2013-10-24 00:32:55 +02:00
Sam Stephenson
275b2f5919 Test checksumming 2012-11-19 18:14:26 -06:00