* test-bot: start running generic tests.
Start running the test suite in the "generic" mode i.e. a base layer for
non-OS X platforms to be able to use to ensure we don't break the generic code
for the parts of the code we've got running.
Currently this just runs the integration tests as that's the only useful suite
that's entirely passing but eventually this will be changed to run the full test
suite in generic mode.
* test_integration_cmds: fix tests on Linux.
Fix minor regression in b55250c44eacd49646407b26a73753965d4d36d0. The
bottle is placed in the current working directory, is unaffected by the
the single teardown introduced in #475, and thus needs manual handling.
Closes#483.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Test was added in 61614d35294c8faffaeb5c7f0ec6dea78dbbc30f, but never
had any effect because it was replaced by a method of the same name a
few lines further down.
Instead of writing a custom ensure for every test let's just nuke
all the files every time. This may be something we might want to use for
other unit tests too. It leans heavily on the fact that a
`FileUtils.rm_rf` on files that don't exist is very quick and things
like `brew cleanup` are super slow in comparison.
Before:
```
$ brew tests --only=integration_cmds --official-cmd-taps
Finished in 49.764724s, 1.0047 runs/s, 5.2648 assertions/s.
```
After:
```
$ brew tests --only=integration_cmds --official-cmd-taps
Finished in 43.014769s, 1.1624 runs/s, 5.8352 assertions/s.
```
Prior to the fix, every run of the test suite would leave behind a pair
of empty directories in `$TMPDIR`. (A temporary home directory was
created but only its child `Applications` was wiped when done.)
This reverts commit 252c701c59227c385ef6178fe99523cca8c843bb.
Taps installed prior to running the test suite are not visible to the
test suite as most Homebrew paths are redefined as to not mess up the
local installation.
All of these taps use Homebrew internal APIs (or will shortly) and we
autoinstall them all from `brew $CMD`. We should adjust our CI to ensure
that we never accidentally break these taps when making changes to core
code so that these taps can rely more on this core code rather than
having to e.g. vendor equivalent code that never changes on our end.
Problems fixed:
- Broken and leaking test if run as part of `brew tests --coverage` due
to the `cmd` call being nested in the `Pathname#cd` block.
- Output during `git clone` operation because of a missing `shutup do`.
- Still incomplete coverage for `cmd/log.rb` because `brew log` is
invoked on the formula in the origin instead of the shallow clone.
- Minor stylistic fixes:
- Superfluous parentheses around `core_tap.path.dirname`.
- Overly long lines.
Amends e4d0187120e61bc80d31ebecc3b38f0740b20bb5. The `require` was
accidentally omitted causing the tests to fail very sporadically (or
always, when invoked as `brew tests --only=integration_cmds`).
This can become handy when we separate core code and formulae. For
example, we could use `cd $(brew --repo homebrew/core)` to go to core
tap path.
ClosesHomebrew/homebrew#50346.
Signed-off-by: Xu Cheng <xucheng@me.com>