Allowing using `HOMEBREW_DOWNLOAD_CONCURRENCY` to use the
`DownloadQueue` for `brew install` by downloading and extracting
bottles in parallel.
This requires some fixes in e.g. `Dependency` and `FormulaInstaller`
to be able to front-load all downloads and handle parallelisation of
bottle pouring.
Behaviour without `HOMEBREW_DOWNLOAD_CONCURRENCY` set should be
unchanged.
Attestations are not handled for now and the UI should be improved
before we roll this out to users.
Post-install upgrades are not yet parallelised.
Co-authored-by: Carlo Cabrera <github@carlo.cab>
While we're here, also add `brew tests --no-parallel` which I relied
on during testing.
Pretty much anywhere we rely on a stubbed formula on disk to work: we
need to disable the API.
These tests were very simple before and now this should result
in more code coverage without affecting test performance.
The only tricky thing was testing the `--missing` option without
actually installing a package using `install_test_formula` because
that is very slow (around 10 seconds on my machine). I ended
up just writing the tab to a plausible keg directory for each
package I wanted to "install". This allows us to test the behavior
while also not increasing CI time by ~20 seconds (though it'd
probably be faster on CI than my local machine).