Commit Graph

239 Commits

Author SHA1 Message Date
Justin Findlay
5dadaec775 add tcp transport to jenkins and runtests 2015-07-20 16:56:00 -06:00
Daniel Hobley
899ba78e79 Added power cfg module and state for windows minions
- Allows you to set power settings on a windows minion for things like the monitor and disk
2015-05-12 14:49:48 +02:00
Colton Myers
befb666623 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
    salt/modules/mongodb.py
    salt/utils/http.py
    salt/utils/process.py
    tests/integration/__init__.py
2015-04-27 10:28:53 -06:00
rallytime
9830708f86 Some small test clean up changes 2015-04-24 16:27:22 -06:00
Mike Place
f3df92834d More helper text, refactor filehandles, clean up 2015-04-03 15:34:47 -06:00
Mike Place
275993ee18 Include parser option for --no-tests 2015-04-03 15:34:46 -06:00
Mike Place
baf2c40f88 More helper text, refactor filehandles, clean up 2015-03-13 16:15:23 -06:00
Mike Place
56650f7e35 Include parser option for --no-tests 2015-03-13 13:18:54 -06:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Colton Myers
c331a3c5cc 644 permissions 2015-01-23 16:59:09 -07:00
Colton Myers
dd61682968 Fix runtests permissions 2015-01-23 14:22:19 -07:00
Mathias Gug
a454d71bd5 Fix coding style. 2015-01-22 14:24:30 -07:00
Mathias Gug
97d0f93fd3 Fix coding style. 2015-01-14 13:06:43 -08:00
jfindlay
f329ec9104 Merge pull request #19422 from Seveland12/develop
Fixed spelling of "below" in 9 different files.
2015-01-07 09:32:44 -07:00
rallytime
98a290ab04 Fix file permissions pylint error 2015-01-07 08:52:32 -07:00
rallytime
5f6af88afb Merge branch '2015.2' into 'develop' 2015-01-07 07:54:10 -07:00
rallytime
80b07f3578 Merge branch '2014.7' into '2015.2'
Conflicts:
	tests/buildpackage.py
2015-01-06 20:32:36 -07:00
Pedro Algarvio
a9eaf187e1 Ignore the file perms lint check 2015-01-07 01:15:56 +00:00
sjwehry
342608d9bd Fixed spelling of "below" in 9 different files. 2015-01-06 19:55:28 -05:00
rallytime
ed3a34624c Fix djangomod.py integration test failures 2015-01-06 22:26:46 +00:00
Nitin Madhok
c992f04f32 Changing permissions of test files and fixing lint violations 2014-12-19 05:50:18 -05:00
Pedro Algarvio
50c437f8c5 Use atexit for the cleanup 2014-11-26 00:41:02 +00:00
Pedro Algarvio
593544b577 Move cleanup_runtime_config_instance out of TestDaemon 2014-11-26 00:20:27 +00:00
Pedro Algarvio
e8104167f4 Forced clean up of runtime config dictionary which includes a local client 2014-11-25 00:33:45 +00:00
Pedro Algarvio
7cab740adf Removed --runner because it's integrated in the client tests 2014-10-08 01:02:10 +01:00
rallytime
72de420e2d Tell jenkins to run integration tests for salt/runner.py 2014-08-28 10:53:22 -06:00
rallytime
e1dde7c574 Enable wheel integration tests in runtests.py 2014-08-27 09:34:44 -06:00
Mike Place
12f851ec3a Clean keyboard exit in test suite 2014-07-10 12:52:43 -06:00
Pedro Algarvio
77aeefe261 Fix dest value 2014-07-10 00:41:26 +01:00
rallytime
e8fde1b125 Add cli option for batch tests to runtests.py 2014-07-09 15:16:13 -06:00
Pedro Algarvio
3c73c9c4c6 Provide a switch to run the NetAPI tests. 2014-06-19 12:58:52 +01:00
Pedro Algarvio
b815bb8cb6 Call the right parent class 2014-06-15 13:05:18 +01:00
Pedro Algarvio
ccdd70750c Leave any cleanup for the end 2014-06-15 13:05:18 +01:00
Pedro Algarvio
7fbc839942 Lay down computed configuration and use that source for all of the tests 2014-06-15 13:05:17 +01:00
Pedro Algarvio
7451e50f63 Limit the options for transport. 2014-06-11 23:09:34 +01:00
Thomas S Hatch
0b02be9af1 Initial code to do raet integration salt tests 2014-06-11 15:35:27 -06:00
Pedro Algarvio
8b03cd8d2e Decorate tests as expensive
Less trouble for the new runtests script
2014-06-10 19:25:04 +01:00
Pedro Algarvio
5a14e33ab3 Add parser option to run cloud provider tests to runtests.py 2014-06-10 03:17:41 +01:00
Pedro Algarvio
57dd2da63e Run the fileserver tests 2014-06-05 10:10:56 +01:00
Mike Place
cf25592c53 Working salt-ssh test runner
This rounds out initial (alpha) support for a salt-ssh test runner.

At present, one must manually specify the --ssh flag to ensure that
the ssh deamons are spun up properly.

Conflicts:
	tests/integration/__init__.py
	tests/integration/files/conf/_ssh/sshd_config
	tests/integration/files/conf/sshd_config
	tests/integration/files/ext-conf/sshd_config
2014-05-23 14:11:14 -06:00
Pedro Algarvio
a1aee355e5 Include outputter tests in tests suite. 2014-05-12 19:10:11 +01:00
Pedro Algarvio
9630d43d05 Add option to run SSH tests.
Refs saltstack/salt-testing#16 and #12661
2014-05-10 14:12:04 +01:00
Pedro Algarvio
8561be1fee For output consistency. 2014-02-09 00:21:18 +00:00
Pedro Algarvio
69d0f907f9 Make use of the print() function. 2014-02-03 11:07:43 +00:00
Pedro Algarvio
59573953b5 Also prepare runtests.py 2014-01-14 15:25:07 +00:00
Pedro Algarvio
0d81bb6416 The SaltTesting parser no longer supports HTML reports. 2013-12-16 00:14:58 +00:00
Pedro Algarvio
de742df8f7 Minor cosmetic printing changes 2013-12-11 14:23:11 +00:00
Pedro Algarvio
ac8963b286 Ignore the relative import warning. 2013-11-27 12:54:13 +00:00
Pedro Algarvio
d02a2bc224 Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
Pedro Algarvio
dfab7aab73 Adapt the runtests parser to support running the tests suite under a Docker container. 2013-11-08 20:20:03 +00:00
Pedro Algarvio
f96c01738e Provide the loader integration tests in it's own package. 2013-10-26 18:57:00 +01:00
Pedro Algarvio
725acec48b track_processes is no longer a valid `kwarg'. 2013-09-10 17:49:38 +01:00
Pedro Algarvio
8100b41c7e Fixed splitting named unittests from named integration tests.
This commit got lost somewhere. I could swear I committed this fix previously...
2013-08-21 19:23:16 +01:00
Pedro Algarvio
11060c85be Allow running a group of tests while still providing a test case name from another group. 2013-08-12 11:46:58 +01:00
Pedro Algarvio
305a5c2223 The parser destructive tests flag is now provided by salt-testing 2013-08-06 22:03:42 +01:00
Pedro Algarvio
94575cbb63 Finish what was started on f78fca32 2013-07-05 00:53:41 +01:00
Pedro Algarvio
f78fca3256 We don't need to pass -u when we're only passing unittests to -n. 2013-07-04 17:17:48 +01:00
Pedro Algarvio
007545eb70 Fix NameError 2013-06-28 00:12:58 +01:00
Pedro Algarvio
8cd0316b62 Heh! Salt! Not Salt Cloud! 2013-06-28 00:12:58 +01:00
Pedro Algarvio
a21b6e10a5 We don't want the tests in the coverage report. 2013-06-28 00:12:58 +01:00
Pedro Algarvio
819e523c2b Use the defined SALT_ROOT as the source parameter for the coverage call. 2013-06-28 00:12:58 +01:00
Pedro Algarvio
7990165e26 Remove debug logic to test coverage. 2013-06-28 00:12:58 +01:00
Pedro Algarvio
3033e0002b Let's make use of salt-testing code coverage testing option parser. 2013-06-28 00:12:57 +01:00
Pedro Algarvio
222be7b446 Make sure every test module is runnable by __main__.
* Double to single quotes
2013-06-28 00:12:56 +01:00
Pedro Algarvio
d4fd1baa2f Adapted the tests suite to work with salt-testing 2013-06-28 00:12:56 +01:00
ZHANG Cheng
c86564abb1 Fix typo 2013-06-22 23:31:37 +08:00
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
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