74 Commits

Author SHA1 Message Date
Andrea Kao
4f95f7ff84 tests: add cmd/irb integration test (#501) 2016-07-19 17:33:36 +02:00
Andrea Kao
4b40a87ca4 tests: nest HOMEBREW_TEMP inside TEST_TMPDIR (#554) 2016-07-19 17:23:44 +02:00
Mike McQuaid
a07ab8bb92 brew.{rb,sh}: move to Library/Homebrew. (#506) 2016-07-15 19:33:30 +01:00
Mike McQuaid
f6dad377b6 test-bot: start running generic tests. (#505)
* 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.
2016-07-14 14:37:50 +01:00
Andrea Kao
c8812522a4 tests: add cmd/link, cmd/unlink integration tests (#398) 2016-07-13 00:22:06 +02:00
Mike McQuaid
ac229f95b5 test_integration_cmds: compile in install test. (#479)
Most of our formulae do compilation so let's do it here too.
2016-07-11 09:20:00 +01:00
Martin Afanasjew
ecc329e33f tests: clean up after bottle test
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>
2016-07-10 16:01:10 +02:00
Martin Afanasjew
942e1a726b tests: fuse broken/split --repository tests
The latter was replacing the former due to an identical method name.
2016-07-10 16:01:10 +02:00
Martin Afanasjew
9eed84b85c tests: remove bogus cleanup test
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.
2016-07-10 16:01:10 +02:00
Mike McQuaid
b55250c44e test_integration_cmds: use a single teardown. (#475)
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.
```
2016-07-08 20:20:43 +01:00
Martin Afanasjew
1b1bf56733 tests: fix leak in '[un]linkapps' integration test (#439)
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.)
2016-07-05 14:36:02 +02:00
Mike McQuaid
a1b0ef1300 Remove unnecessary official command tapping. 2016-07-04 18:26:47 +01:00
Mike McQuaid
26dcc9786d test_integration_cmds: loosen cask test. 2016-07-04 17:17:20 +01:00
Mike McQuaid
bf42959609 Revert "Revert "Test officially supported cmd taps. (#390)""
This reverts commit dba1958bd79c1c9d18f215dfc2b806ea62edd1c8.
2016-07-04 17:05:37 +01:00
Martin Afanasjew
dba1958bd7 Revert "Test officially supported cmd taps. (#390)"
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.
2016-07-04 17:41:14 +02:00
Mike McQuaid
252c701c59 Test officially supported cmd taps. (#390)
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.
2016-07-04 16:08:53 +01:00
Andrea Kao
8b31167a43 tests: refactor formula file creation (#370) 2016-06-22 13:37:17 +01:00
Andrea Kao
cad85754cf tests: add cmd/search integration test (#356) 2016-06-19 22:20:20 +01:00
Martin Afanasjew
8a70b000e5 tests: fix problems in 'log with formula' test (#350)
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.
2016-06-14 14:58:11 +02:00
Andrea Kao
3f7fffe17d tests: extend cmd/log integration test (#333) 2016-06-12 13:50:34 +01:00
Andrea Kao
5ac6eb434e tests: extend cmd/desc integration test (#314) 2016-06-03 13:10:38 +01:00
Martin Afanasjew
d2cdbcbb18 tests: add missing require
Amends e4d0187120e61bc80d31ebecc3b38f0740b20bb5. The `require` was
accidentally omitted causing the tests to fail very sporadically (or
always, when invoked as `brew tests --only=integration_cmds`).
2016-06-02 09:36:51 +02:00
Andrea Kao
e4d0187120 tests: extend cmd/home integration test (#305) 2016-06-02 01:26:32 +02:00
Mike McQuaid
f12932cf31 test_integration_cmds: fix when not a developer. 2016-05-30 21:44:59 +01:00
Mike McQuaid
0158fc6da8 test_integration_cmds: print output on failure. (#213)
Makes it easy to debug what’s gone wrong.
2016-05-08 17:12:31 +01:00
Mike McQuaid
61614d3529 test_integration_cmds: add cleanup test. 2016-05-08 17:11:57 +01:00
Martin Afanasjew
02289fce42 Update Homebrew/homebrew references in code
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Martin Afanasjew
b53f0c5ada tests: expand help and help-related tests
Closes #114.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:46:10 +02:00
Martin Afanasjew
d183ff8065 tests: fix Ruby 1.8 syntax warnings
In `Library/Homebrew/test/`:

test_integration_cmds.rb:431: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:502: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:507: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:585: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:709: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:710: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:711: warning: (...) interpreted as grouped expression
2016-04-20 01:42:14 +02:00
Martin Afanasjew
7771f3af81 tests: update prune --verbose test
Closes #15.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06 10:31:54 +02:00
Martin Afanasjew
f2245adaa7 tests: update linkapps/unlinkapps tests 2016-04-06 10:31:54 +02:00
Xu Cheng
deea4c82a4 fix brew tests
Fix the `brew tests` problem caused by core/formula separation.
2016-04-02 21:51:36 +08:00
Xu Cheng
b8a4677de0 --repository: support to show tap path
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.

Closes Homebrew/homebrew#50346.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-24 14:52:13 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
eb6f970b90 tap: support --quieter flag
Closes Homebrew/homebrew#49551.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 18:42:36 +08:00
Xu Cheng
e5b6f79b22 bottle: do not follow symlink when setting mtime
Also set atime to mtime, which seems to be a more common practice.

Fixes Homebrew/homebrew#49007

Closes Homebrew/homebrew#49027.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-10 21:01:12 +08:00
Baptiste Fontaine
eba429d947 tests: add leaves & prune integration tests
Closes Homebrew/homebrew#48943.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-07 13:30:40 +01:00
Baptiste Fontaine
570345d1a0 tests: cleanup test bottle 2016-02-07 13:30:40 +01:00
Baptiste Fontaine
115e6b49bc tests: monkey-patch exec to get coverage reports
Closes Homebrew/homebrew#48923.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-07 11:52:26 +01:00
Baptiste Fontaine
4ce99fa010 tests: remove unnecessary cd 2016-02-07 11:52:25 +01:00
Baptiste Fontaine
268fa841de tests: fix simplecov handling in integration tests
Closes Homebrew/homebrew#48250.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-06 14:20:58 +01:00
ilovezfs
fb9818ae8c HOMEBREW_BREW_FILE was unset for the tests
This fixes a regression introduced by 3f6a355, which caused
HOMEBREW_BREW_FILE to be unset while running the tests.

Patch provided by Xu Cheng.
2016-02-05 21:52:11 +08:00
ilovezfs
051cd36046 test_integration_cmds: fix warning.
Closes Homebrew/homebrew#48772.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-03 21:09:12 +00:00
Baptiste Fontaine
bdf0e0ef4d tests: remove the problematic test-bot test
It makes Travis checks fail on the master.
2016-02-03 18:11:29 +01:00
Baptiste Fontaine
299419a881 tests: more integration tests
Closes Homebrew/homebrew#48785.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-03 16:28:28 +01:00
Baptiste Fontaine
6cccc2d0fe tests: remove unnecessary code 2016-02-03 16:28:28 +01:00
Baptiste Fontaine
a173196e32 tests: more integration tests
Closes Homebrew/homebrew#48674.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-31 16:03:36 +01:00
Baptiste Fontaine
86eb44c96c tests: more integration tests
Closes Homebrew/homebrew#48635.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-31 00:46:35 +01:00
Baptiste Fontaine
47aa71e633 tests: don't try to rm an unexisting file
This line is necessary if the test fails. If it passes the file won't
exist anymore and shouldn't be removed.
2016-01-27 23:03:44 +01:00