Tests shouldn't fail in case of an unavailable network or a deliberately
disabled access to the GitHub API.
ClosesHomebrew/homebrew#47670.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This tests all possible combinations of alpha, beta, RC, regular, and
patch versions. Also improves code coverage and partitions the version
comparison tests into more uniform chunks.
ClosesHomebrew/homebrew#47669.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
If the test fails above `formula_file`’s definition this line fails
because `formula_file` is `nil`.
ClosesHomebrew/homebrew#47663.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This test wasn't running by default, so we missed that it wasn't
actually being executed - or that it was failing when running in the
testing environment.
As far as I can tell this is not, and has not, been used either in core
or in any tap, third party or otherwise, so just remove the feature and
its test.
Also reuse this improved implementation in the GitHub rate limit errors.
ClosesHomebrew/homebrew#44721.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
If the source contains a broken symlink, `brew bottle` would fail for no
good reason when trying to determine the most recently modified
file. To avoid this, we ignore any files for which stat(2) fails.
ClosesHomebrew/homebrew#47111.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
While it may suffice to merge string and non-reserved tags by forming a
union of all tags of dependencies of the same name, this approach fails
to work for the reserved tags. These are now merged such that the most
restrictive tag (meaning sometimes an empty tag) is preserved.
The previous behavior caused essential dependencies to be omitted and
builds to fail in response. E.g., multiple `:fortran` dependencies with
tags `[]`, `[:recommended]`, and `[:optional]` would have been expanded
and merged to `"gcc"` with tags `[:recommended, :optional]`, causing it
to be no longer seen as a required dependency.
ClosesHomebrew/homebrew#47040.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
The general idea is that merging multiple dependencies of the same name
should produce the strictest tag instead of a (meaningless) union of the
reserved tags. For example, if a dependency is both a `:recommended` and
an `:optional` dependency at different points in the dependency tree,
the resulting merged dependency should be tagged as `:recommended`.
Handle all other reserved tags in the same spirit.
These tests were using too much semi-global state (instance variables)
and relied unnecessarily on the exact number of calls to `optional?` and
`recommended?` in the `Depedable` module.
This means that dependencies can be merged but still maintain all
their option names.
ClosesHomebrew/homebrew#46916.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Without this the returned string is not as accurate if the method is
called with an int larger than 120.
ClosesHomebrew/homebrew#47002.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>