Commit Graph

239 Commits

Author SHA1 Message Date
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
Thomas S Hatch
0b9f381781 Add runners to the main test script 2012-05-27 21:01:08 -06:00
Thomas S Hatch
97966f521a Add state functions to integration tests 2012-05-12 22:27:30 -06:00
Thomas S Hatch
6ab9242def Add option to test states 2012-05-12 20:55:56 -06:00
Baiju Muthukadan
5533fe4417 JUnit like XML reporting for Jenkins 2012-05-06 03:57:16 +05:30
Baiju Muthukadan
0605365daf Support verbose output for testrunner
The option parsing logic has changed without affecting the test
invocation commandline interface.
So, it should be possible to invoke tests like this:

  python tests/runtests.py -u #only run unit tests
  python tests/runtests.py -m #only run module tests
  python tests/runtests.py #run all tests
  python tests/runtests.py -v #run all tests with verbose output
  python tests/runtests.py -vu #run unit tests with verbose output
2012-05-06 02:12:47 +05:30
Baiju Muthukadan
d2d31bd8b4 non-unit tests should be able to run individually 2012-05-05 18:07:39 +05:30
Baiju Muthukadan
763a4287cf Exit testrunner with proper exit code 2012-05-05 17:23:39 +05:30
Anselm Helbig
5bc9ea7d67 added preliminary unit tests for rvm module 2012-05-02 09:42:01 +02:00
Thomas S Hatch
e301fee420 Add shell tests and shellCase to test structure 2012-04-21 17:27:59 -06:00
Monty Taylor
c9950cc571 Clean up code for 3.2 2012-04-20 13:20:51 -07:00
Thomas S Hatch
f646d9f38f add options to runtests allowing for specific suites to be run 2012-04-04 11:49:28 -06:00
Thomas S Hatch
fdd75e81f6 Add some pretty to the unit tests 2012-04-04 10:58:11 -06:00
Thomas S Hatch
6c0c05c523 Add support for a dir of client tests 2012-04-03 21:14:09 -06:00
Eivind Uggedal
ab7ace6aa5 Split out integration tests from pure unit tests.
Integration tests requiring a salt master and daemon were seperated
from pure unit tests. For now both are run with runtest.py. In
the future it could take arguments for which type of tests to run.
2012-02-20 13:18:13 +01:00
Eivind Uggedal
099470ab37 Terminate master and minion processes after tests are finished. 2012-02-20 00:07:38 +01:00
Thomas S Hatch
21cebcc091 run all modules in the modules dir 2012-02-12 16:10:50 -07:00
Thomas S Hatch
fd82c47a95 more refinements to unittesting 2012-02-12 16:03:31 -07:00
Thomas S Hatch
71c81ce2e8 The new unit tests work! 2012-02-12 02:58:15 -07:00
Thomas S Hatch
5b83d74e2d move core classes to daemon, add moduleclass 2012-02-12 01:57:03 -07:00
Thomas S Hatch
07b4320a89 Initial push towards active unit testing
After a great deal of thought, I feel that the only way to reliably run
a test suite it to start a minion and master, and condition the data to
reflect the literal returns (take out the transport overhead).

This commit is the initial push towards this method of unit testing,
these test will be able to acctually test every aspect of salt.
2012-02-12 01:24:20 -07:00
Evan Borgstrom
11cc43d22d Now that it's working let's make it a little nicer to use [GH-522]
This allows for tests to be written without too much change from the
normal unittest workflow. Now they should use the 'saltunittest'
namespace and we will need to import anything we need from the original
'unittest' or 'unittest2' namespace.
2012-01-29 10:17:51 -05:00
Evan Borgstrom
dde4198dae Allow tests to be run on python < 2.7 [GH-522]
note: the host module test seems to be broken.
2012-01-29 10:01:43 -05:00
Martin Schnabel
43a6bcf299 add simple test runner.
use:
   python setup.py test
to build salt and run all 'unittest.TestCase's in tests/
2011-12-30 00:55:05 +01:00