Commit Graph

73 Commits

Author SHA1 Message Date
Thomas S Hatch
86db665d2d kill the print 2013-06-18 15:45:50 -06:00
Thomas S Hatch
535d0a00e3 Finish #5585 2013-06-17 13:05:08 -06:00
ZHANG Cheng
c8aee0451d Make it possible to run a single unit test 2013-06-17 23:38:13 +08:00
Chris Rebert
a6a356a3e4 runtests.py: use except-as syntax 2013-06-03 11:45:44 -06:00
Pedro Algarvio
8938b93b3f Run our own API based coverage 2013-06-02 09:07:39 +01:00
Pedro Algarvio
a61273bd71 Finally working. Cleaning up. 2013-05-31 12:48:53 +01:00
Pedro Algarvio
662f5b23ca Output the coverage pickled data. 2013-05-31 12:48:53 +01:00
Pedro Algarvio
63859e2915 Even more info from travis env. 2013-05-31 12:48:53 +01:00
Pedro Algarvio
51460af985 Fix SyntaxError. 2013-05-31 12:48:53 +01:00
Pedro Algarvio
5ec8147fbb Add the .coveragerc file and some debugging output to see if the coverage file is generated. 2013-05-31 12:48:52 +01:00
Pedro Algarvio
852e38658b Let's know where(CWD) is the suite running from. 2013-05-31 12:48:52 +01:00
Thomas S Hatch
25fd45a688 Make --name a little more clear 2013-05-26 00:08:52 -06:00
Chris Rebert
c487d86fff tests: standardize to modern 'except FooError as err:' syntax 2013-05-03 19:55:50 -07:00
Chris Rebert
9ed364980d is not 0 => != 0 2013-04-30 10:32:21 -07:00
Pedro Algarvio
a43e0132f1 Improve logging logic in salt/template.py. Allow the test suite to set more logging levels. 2013-04-27 09:56:24 +01:00
Pedro Algarvio
7e0b13a493 Include the filesystem cleanup options group into the parser. 2013-04-19 22:36:02 +01:00
Pedro Algarvio
8f851e0a9a Renamed environment variable and create directory if it does not exit.
New environment variable name is `SALT_XML_TEST_REPORTS_DIR`.
2013-02-02 18:27:59 +00:00
Pedro Algarvio
6efbc51aae Remove bad xml reports option.
* `xmlrunner` proved to be a way better choice than `junitxml` and it's even parsable by Bamboo. The output of `junitxml` is not.
* The output directory can be tweaked with the environment variable `SALT_XML_TEST_REPORTS`.
2013-02-02 18:22:31 +00:00
Pedro Algarvio
b994f3e697 Re-use the same file for JUnit xml text results instead of overriding. 2013-02-01 18:55:34 +00:00
Pedro Algarvio
17c6151cf8 Add --no-colours to runtests.py. Refs #3511. 2013-01-30 21:01:20 +00:00
Pedro Algarvio
17aee1fc32 Add JUnit compatible xml output to the tests suite. 2013-01-30 20:42:30 +00:00
Pedro Algarvio
ed7c4c97f8 Group parser options. 2013-01-30 20:10:45 +00:00
Ryan Schneider
8f8cc74b34 Some minor cleanup of unit and integration tests. 2012-12-18 17:39:16 -08:00
Pedro Algarvio
e2d404950b Show us the pid for which the test suite is running under. 2012-12-04 11:24:24 +00:00
Pedro Algarvio
804b575b0d Add missing import. 2012-11-29 07:59:36 +00:00
Pedro Algarvio
b72469d4b0 New coverage version, handle it's version parsing properly. 2012-11-29 07:41:17 +00:00
Pedro Algarvio
04146f39f9 Tests wait timer is now colored(option to disable colors is also available), improves readability. 2012-11-21 10:01:45 +00:00
Pedro Algarvio
f6abd10ed9 Support logging.StreamHandler under python 2.6 which does not have a stream kwarg. 2012-11-20 15:52:20 +00:00
Pedro Algarvio
c5c637154a Try to get some system information out of Travis-CI. 2012-11-06 18:11:26 +00:00
Pedro Algarvio
af7ebf12f8 Try not to fail on travis-ci under python 2.6
* Raised max open files by 1024 since running in a vagrant machine 2048 was not enough, though, I think travis-ci defaults to a higher value.
* Wait a bit longer on the events testing.
* Separated the initial minions connected and minions synced into two different events and functions. Also corrected the `if` expected value when a timeout occurs.
2012-11-06 16:02:36 +00:00
Pedro Algarvio
75644992e2 Don't hard-code temporary paths on tests. Refs #2462. 2012-11-06 11:20:06 +00:00
Pedro Algarvio
b6cb78364f Switch integration tmp to the system's temporary directory.
While running the tests within a VirtualBox(vagrant) machine, if the salt source is mounted using shared folders, any tests involving hard links WILL fail. Any tests involving symlinks, can be made to work by setting some properties on the VirtualBox shared folder. By moving the tests `tmp` directory to `tempfile.gettempdir()` we avoid this false test case errors.
2012-10-05 00:52:00 +01:00
Pedro Algarvio
4c456864db Improve our tests runner.
* Show an error when the user tries to use `--xml` and `xmlrunner` is not installed.
* Add support to generate HTML reports of the tests coverage.
2012-10-02 13:04:22 +01:00
Pedro Algarvio
905fb835cd Improve runtests.py logging and report output.
* All logging messages are now logged on a log file. If verbose is enabled, the log messages are also logged to the console.
 * The tests report now also let's us know if there were no glitches.
2012-09-30 10:40:06 +01:00
Pedro Algarvio
e8766b7b8d Allow certain tests to marked as destructive.
* Some tests might be considered destructive, such as adding or removing users from the system. This change allows those tests to be skipped unless stated otherwise.

```python

from saltunittest import destructiveTest

class ATestCase(TestCase):

    @destructiveTest
    def test_some_destructive_code(self):
        """Some destructive code."""

```

On the console we get something like:
```
test_destructive (unit.config_test.ConfigTestCase) ... skipped 'Destructive tests are disabled'
```
2012-09-29 15:42:43 +01:00
Pedro Algarvio
6896fd0ab8 Allow disabling the tests report. 2012-09-29 12:48:50 +01:00
Pedro Algarvio
b8917071f6 Provide an overall tests report.
Previously we have to go through the scroll history to see which tests failed, which were skipped, etc. Now, besides test failures, errors and skips being reported like they always were, we also provide a nice overall report and the end.
2012-09-29 12:10:06 +01:00
Pedro Algarvio
582011a8be Allow passing multiple test names(-n) to runtests.py. 2012-09-26 16:17:27 +01:00
Pedro Algarvio
39af3fb5d6 Fix the test-cases custom logging handler.
* Even when the tests logging handler stream is directed to `/dev/null` we still need a low logging level so that our custom logging handler, used to see if certain log messages are emitted or not, catches messages.
2012-09-20 19:27:32 +01:00
Pedro Algarvio
6110a72231 Fix syntax error from last commit. 2012-09-03 19:10:38 +01:00
Pedro Algarvio
e2d0ffa992 Automatically try to raise max open files setting if too low when running tests. 2012-09-03 17:42:36 +01:00
Pedro Algarvio
c06541bdf0 Allow some logging output when running tests. 2012-08-25 14:21:19 +01:00
Pedro Algarvio
c5f1236984 There's no logging NullHandler in 2.6. Fix it. 2012-08-11 21:03:49 +01:00
Pedro Algarvio
9dfce0f7d2 Final fix for saltstack/salt#1756
Don't try to import `salt.log` during tests. Adapt `check_user` test accordingly.
2012-08-11 01:28:49 +01:00
Pedro Algarvio
80804c67b4 Some more fixes regarding saltstack/salt#1756
Setup and disable logging during the tests.
2012-08-11 00:44:16 +01:00
Pedro Algarvio
842036b136 Minor cosmetic change while running tests.
Make the salt's printed `~~` lines match the length of the `--` printed lines from unittest.
2012-08-01 19:07:56 +01:00
Roman Imankulov
4cac03c42d Add options --clean and --no-clean in runtest.py
--no-clean option speeds up repeating test execution by skipping the cleanup
process before and after testing.

Typical use case command could look like

./runtests.py -vv --no-clean --name integration.modules.ssh
2012-07-20 12:16:14 +06:00
Larry Price
c2f89a849d adding state tests to the full run :-/ 2012-06-30 09:40:00 -07:00
Thomas S Hatch
dc6138b787 move runner tests to the front to clean up the output 2012-05-30 17:10:48 -06:00
Dan Colish
f5c8e242e4 Refactor runtests to allow dotted path module discovery.
In addition to traditional file system path test discovery it is
useful to run a test by stating it's dotted python path. For example,
this will only run the cmdmod integration tests from the
module suite::

        $ runtests.py -n tests.integration.modules.cmdmod
2012-05-29 19:56:47 -07:00