Commit Graph

9394 Commits

Author SHA1 Message Date
Pedro Algarvio
7fffd93b50
Don't pollute the repo tests state tree 2017-03-08 18:34:33 +00:00
Pedro Algarvio
df942bc082
Add a repeat decorator to retry passing tests N times until it fails 2017-03-08 18:34:33 +00:00
Pedro Algarvio
b391a4eb5b
Supervisord does not work under Python 3 2017-03-08 18:34:33 +00:00
Pedro Algarvio
e2e303e724
Minor changes to paths 2017-03-08 18:34:32 +00:00
Pedro Algarvio
712b81e0c1
supervisor does not run against py3. Use pep8 for the tests. 2017-03-08 18:34:32 +00:00
Pedro Algarvio
07d0a5ed20
Cleanup after ourselves 2017-03-08 18:34:32 +00:00
Pedro Algarvio
ad4430249f
Don't complain about basic python types 2017-03-08 18:34:31 +00:00
Pedro Algarvio
c436d9f2f6
This no longer applies. 2017-03-08 18:34:31 +00:00
Kadlec Jan
93306ba8a8 Fix linode white space 2017-03-08 17:14:56 +01:00
rallytime
4fc9b5484b Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/client/ssh/__init__.py
  - salt/pillar/makostack.py
  - tests/integration/client/test_runner.py
  - tests/integration/states/test_file.py
2017-03-08 09:04:26 -07:00
Kadlec Jan
2c67cfdbdb Add function for matching key/value grains 2017-03-08 15:14:46 +01:00
Pedro Algarvio
0604fdeb8b
Don't warn if the attributes are set to None 2017-03-07 12:23:17 +00:00
Pedro Algarvio
3aa54e6e0e
Clean up after ourselves 2017-03-07 12:23:17 +00:00
Pedro Algarvio
46ba8704cd
Default to showing CPU and MEM, and optionally zombies 2017-03-07 12:23:17 +00:00
Pedro Algarvio
06c77b00d8
Also make sure we cleanup any setUpClass left over attributes 2017-03-07 12:23:17 +00:00
Pedro Algarvio
fd7d665f67
Enable SHOW_PROC just to get some insight. This will be removed before merge. 2017-03-07 12:23:16 +00:00
Pedro Algarvio
ca6084ea64
A more brute force approach to try to reduce memory usage on test runs.
We just keep a record of all the test case class attributes prior to
running the test and then just delete it afterwards.
We also issue a warning log message to tell the users how to cleanup
such references.
2017-03-07 12:23:16 +00:00
Rafael Caricio
c5a7b68aac
Use new test libs 2017-03-07 11:40:10 +01:00
Rafael Caricio
be2c2fab3f
Move to new style of tests 2017-03-07 09:53:48 +01:00
Nicole Thomas
8ecc719f90 Merge pull request #39852 from rallytime/bp-39651
Back-port #39651 to 2016.11
2017-03-06 14:18:33 -07:00
dharper
e2a232921d Checking instance exists in master._get_cached_minion_data when cache.fetch returns None 2017-03-06 09:09:03 -07:00
Pedro Algarvio
3ec0870ef6
Disable 3rd-party-module-not-gated 2017-03-06 14:42:31 +00:00
Pedro Algarvio
7dc6b64689
No need to call .keys() when iterating a dictionary 2017-03-06 14:42:31 +00:00
Pedro Algarvio
41543bba99
Disable pylint blacklisted-external-module 2017-03-06 14:35:18 +00:00
Pedro Algarvio
ffec7dc299
Lint fixes 2017-03-06 14:35:16 +00:00
Pedro Algarvio
6c9152764d
Use tests.support.mock 2017-03-06 14:35:13 +00:00
Pedro Algarvio
140b97ee8b
We need __version__ in the tests.support.mock scope 2017-03-06 14:35:12 +00:00
Pedro Algarvio
d13b40554b
Use the __version__ variable from tests.support.mock 2017-03-06 14:35:12 +00:00
Rafael Caricio
aa171a5468 Add support to Telegram Bot messages beacon 2017-03-05 16:09:47 +01:00
Mike Place
3341e4e202 Merge pull request #39492 from whiteinge/full_return-arg
Add full_return arg to LocalClient and RunnerClient
2017-03-04 09:14:17 -07:00
Mike Place
c10abec6d3 Merge pull request #39797 from twangboy/win_fix_test_git
Fix test_worktree_add_rm test for Windows
2017-03-04 09:12:12 -07:00
Silvio Moioli
573d6e9dfb minionswarm.py: add flag to delay starts 2017-03-04 14:52:18 +01:00
Pedro Algarvio
69f1c0fc64 Merge pull request #39822 from s0undt3ch/features/py3
A tiny bit more of py3
2017-03-03 22:12:11 +00:00
Pedro Algarvio
44ba96613b
This needs to be done as a PyLint plugin not as this kind of test.
It's the only way we can check all code paths of the __virtual__
function.
Regarding the 3rd-party modules gating, we also need to create a pylint
plugin which known what are the hard deps of Salt and will complain on
all other 3rd-party imports.
2017-03-03 20:35:17 +00:00
Pedro Algarvio
f4732d5433
Lint fixes 2017-03-03 19:28:45 +00:00
Pedro Algarvio
adacf4cc28
Don't expect any ordering from sets!!!!! 2017-03-03 18:31:11 +00:00
twangboy
2a6e61a42e Add encode for Py3 compatability 2017-03-03 10:53:12 -07:00
twangboy
54891a57b1 Fix type in second worktree_path 2017-03-03 10:24:28 -07:00
Mike Place
7460e460e1 Merge pull request #39808 from carlpett/vault-lowercase-policies
Vault: Always lowercase policies
2017-03-03 08:21:59 -07:00
Pedro Algarvio
f5de085ac4
Add test case which will catch SOME problems with __virtual__ calls.
And also 3rd-party import errors.
2017-03-03 15:19:34 +00:00
Pedro Algarvio
5f388e7ea2
Minor fixes 2017-03-03 15:19:24 +00:00
Pedro Algarvio
e180f1e913
Normalize the mode 2017-03-03 15:15:13 +00:00
Pedro Algarvio
3b0b60dd9f
Error out when the path passed is not valid tests module 2017-03-03 12:41:27 +00:00
Pedro Algarvio
c687b6112a
Account for test module names prefixed with tests. 2017-03-03 12:41:27 +00:00
Calle Pettersson
c745415b8b Vault: Always lowercase policies 2017-03-03 09:05:27 +01:00
Mike Place
9ce11794b7 Merge pull request #39800 from twangboy/win_fix_test_useradd
Fix test_add_user_to_group for Windows
2017-03-02 22:26:35 -07:00
Mike Place
02f00a9c41 Merge pull request #39795 from twangboy/fix_whitelist
Fix incorrect test name
2017-03-02 22:16:37 -07:00
twangboy
25938ebc8e Fix test_add_user_to_group for Windows 2017-03-02 15:40:22 -07:00
twangboy
ef53ec7efe Fix test_worktree_add_rm test for Windows 2017-03-02 14:37:53 -07:00
Pedro Algarvio
cb293f2f6d Merge pull request #39649 from s0undt3ch/features/py3
Moar Py3
2017-03-02 21:16:51 +00:00
Pedro Algarvio
ab4f0aac6a Merge pull request #39792 from s0undt3ch/features/pytest-salt-daemons
Allow passing a test module path to runtests.py to run its tests
2017-03-02 21:16:04 +00:00
twangboy
eb0b7227e9 Fix incorrect test name 2017-03-02 13:31:52 -07:00
Pedro Algarvio
5b5a6ebbe8
Minor code cleanup 2017-03-02 19:58:10 +00:00
Pedro Algarvio
5e3309d5f8
Let's use the skip_if_not_root decorator instead 2017-03-02 19:58:10 +00:00
Pedro Algarvio
2f3d0b0b81
These are not destructive tests 2017-03-02 19:58:10 +00:00
Pedro Algarvio
80002276c2
These tests are not destructive 2017-03-02 19:58:10 +00:00
Pedro Algarvio
519a3f689e
These tests are not destructive 2017-03-02 19:56:06 +00:00
Pedro Algarvio
31df825a1c
Set the ssh_log_file relative 2017-03-02 19:56:06 +00:00
Pedro Algarvio
fc501e93ac
Remove deprecated options 2017-03-02 19:56:05 +00:00
Pedro Algarvio
cbef6c044f
Re-enable the test since we now have the flaky decorator 2017-03-02 19:56:05 +00:00
Pedro Algarvio
96bcaf5365
The order is shady under Py3
/cc @cachedout @rallytime
2017-03-02 19:56:05 +00:00
Pedro Algarvio
7b4d849540
Moved some test supporting modules to tests/support
Previously they were in tests/utils which also had test case modules.
2017-03-02 19:56:05 +00:00
Pedro Algarvio
979090d225
We need bytes under Py3 to compute the hash 2017-03-02 19:56:04 +00:00
Mike Place
8de198f9b1 Merge pull request #39655 from twangboy/win_fix_renderers_tests
Fix renderers tests for Windows
2017-03-02 12:27:26 -07:00
Pedro Algarvio
661b6416b7
Allow passing a test module path to runtests.py to run its tests
Example:

```
python tests/runtests.py -v tests/integration/states/test_alternatives.py
```
2017-03-02 19:12:43 +00:00
Seth House
c25ffd5d2e Add LocalClient and RunnerClient full_return tests 2017-03-02 11:46:27 -07:00
Mike Place
e558ce5d23 Merge pull request #39787 from s0undt3ch/features/pytest-salt-daemons
Try to reduce memory consumption during full test runs
2017-03-02 11:17:44 -07:00
Pedro Algarvio
9711f65d70
Try to reduce memory consumption during full test runs 2017-03-02 18:13:54 +00:00
Mike Place
9f70ad7164 Merge pull request #39472 from whiteinge/_reformat_low-update
Update _reformat_low to not run kwarg dicts through parse_input
2017-03-02 10:46:19 -07:00
Shane Lee
eb6d317289 Merge branch 'develop' into win_fix_renderers_tests 2017-03-02 10:29:36 -07:00
Mike Place
71410047f0 Merge pull request #39682 from ni3mm4nd/mongodb_user
Add support for user roles in present state
2017-03-02 10:17:38 -07:00
Mike Place
7dfc4b572a Merge pull request #39727 from terminalmage/issue39627
salt.modules.state: check gathered pillar for errors instead of in-memory pillar
2017-03-02 10:06:42 -07:00
Mike Place
555f1473f6 Merge pull request #39788 from cachedout/disable_api_test
Disable one API test that is flaky
2017-03-02 09:17:31 -07:00
Mike Place
523e377b33
Disable one API test that is flaky 2017-03-02 09:16:43 -07:00
Mike Place
2d711782e8 Merge pull request #39736 from techhat/spmstates
Add pre and post states to SPM
2017-03-01 19:57:41 -07:00
Joseph Hall
bdb26ddf83 Create master cache dir 2017-03-01 16:09:13 -07:00
rallytime
776a9431b9 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/minion.py
2017-03-01 16:07:14 -07:00
twangboy
ad654abc20 Clarify the reason for the while loop 2017-03-01 14:00:06 -07:00
twangboy
25b6d221c4 Fix ext_grains and ext_modules tests for Windows 2017-03-01 14:00:06 -07:00
Joseph Hall
8058bbe6ca Just set all the default minion opts and be done with it 2017-03-01 13:12:18 -07:00
Joseph Hall
925eb7ffea Add environment to test 2017-03-01 12:56:23 -07:00
Mike Place
320b39bc12 Fix broken test and lint issue 2017-03-01 11:57:28 -07:00
Joseph Hall
88a38d5ee9 Add id to test 2017-03-01 11:42:05 -07:00
Erik Johnson
3bb0ebd872 Update tests for PR 39727
Also reduce the complexity of some of the mocking by adding the cachedir
to the global state.__opts__.
2017-03-01 12:10:28 -06:00
Joseph Hall
8b8320d56d Add renderer variable to tests 2017-03-01 10:41:52 -07:00
Joseph Hall
bd2e1427ad Add cachedir to test 2017-03-01 10:40:31 -07:00
Mike Place
517842a339 Merge pull request #39696 from twangboy/win_fix_returners_tests
Fix job cache tests, add librato return tests
2017-03-01 10:24:59 -07:00
Mike Place
4fc0451d64 Merge pull request #39702 from techhat/spmfiles
Add files section to FORMULA files
2017-03-01 10:18:30 -07:00
Mike Place
4a0c2dfcc3 Merge pull request #39725 from bodhi-space/infra4487
INFRA-4487 - 'test=True' should return True rather than None if no changes are scheduled.
2017-03-01 10:02:11 -07:00
Erik Johnson
64db0b8563 Add integration tests for remote file sources 2017-03-01 10:57:06 -06:00
Mike Place
33e40c94e4
Fix docs test for #39753 2017-03-01 09:06:17 -07:00
Kadlec Jan
d5d99d6399 recteate unit tests 2017-03-01 07:13:28 +01:00
Tom Williams
aa8d822e78 INFRA-4487 - fix unit test to match corrected return value 2017-02-28 21:01:57 -05:00
Pedro Algarvio
a78c037a5f
PyLint, no its not a repeated keyword! 2017-03-01 01:33:08 +00:00
Pedro Algarvio
4f425e596b
Don't assert, just fail 2017-03-01 01:33:08 +00:00
Pedro Algarvio
bb60e5010c
Redundant 2017-03-01 01:33:08 +00:00
Pedro Algarvio
ab83cced63
Child processes termination cleanup 2017-03-01 01:33:07 +00:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
twangboy
037dfb3ece Fix lint error 2017-02-28 15:56:06 -07:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
08804932c3
Using pytest start_daemon 2017-02-28 22:52:48 +00:00
Pedro Algarvio
53eff91efa
Re-enable the test since we now have the flaky decorator 2017-02-28 22:52:48 +00:00
Pedro Algarvio
2a9d2beb02
The order is shady under Py3
/cc @cachedout @rallytime
2017-02-28 22:52:48 +00:00
Pedro Algarvio
1daa2e24cd
Moved some test supporting modules to tests/support
Previously they were in tests/utils which also had test case modules.
2017-02-28 22:52:48 +00:00
Pedro Algarvio
7278a6c868
You need to pass a list. How did this ever pass?! 2017-02-28 22:52:48 +00:00
Mike Place
ec79d238fb Merge pull request #39732 from gtmanfred/develop
Add queueing of runner tasks using the scheduler and queue runner
2017-02-28 15:09:43 -07:00
Mike Place
a73a5f9c1f Merge pull request #39646 from terminalmage/zh921
Handle deprecation of passing string args to load_args_and_kwargs
2017-02-28 14:59:33 -07:00
Daniel Wallace
39bb623bdc fix pylint 2017-02-28 14:53:02 -06:00
Daniel Wallace
878b21662e add test for queue 2017-02-28 14:10:41 -06:00
Calle Pettersson
4154910dd3 Vault: Handle patterns with non-existing keys 2017-02-28 21:07:49 +01:00
Nicole Thomas
8809d33674 Merge pull request #39701 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-02-28 12:50:10 -07:00
Joseph Hall
6c5bc20344 Handle paths for multiple operating systems 2017-02-28 11:41:29 -07:00
rallytime
ddf8f87249 Add some additional mocks for win_iis unit test 2017-02-28 10:36:11 -07:00
Erik Johnson
7b958fb389 Add options to skip fileserver/git_pillar preflight checks
This commit also modifies the master config for the test suite to use
this new option, so that a missing GitPython/Pygit2 will not crash the
test suite's master. This should make the test suite run smoother by
only negatively impacting those tests which require the pillar data
provided by git_pillar, when a valid provider is not available.
2017-02-27 20:21:53 -06:00
Mike Place
09ac8822c5 Merge pull request #39672 from carlpett/feature/vault-list-expansion
Vault: Add support for expanding lists in policies
2017-02-27 17:33:02 -07:00
Joseph Hall
d1f0a74a7c Add files section to FORMULA files 2017-02-27 16:59:13 -07:00
rallytime
b4366103a6 Merge branch '2016.11' into 'develop'
Conflicts:
  - .pylintrc
  - .testing.pylintrc
  - salt/fileclient.py
  - salt/minion.py
  - salt/modules/docker.py
  - salt/modules/win_iis.py
  - salt/states/docker.py
  - salt/states/file.py
  - salt/utils/__init__.py
  - tests/integration/modules/test_sysmod.py
2017-02-27 15:11:37 -07:00
twangboy
dc42987137 Add integration.sdb.test_env tests 2017-02-27 15:09:25 -07:00
twangboy
b434523a51 Fix job cache tests, add librato return tests 2017-02-27 13:26:42 -07:00
Mike Place
3037e7de46 Merge pull request #39651 from DennisHarper/fixNoneCache
Checking Instance when calling a function that can return None
2017-02-27 13:21:00 -07:00
rallytime
756f1de2d2 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/states/file.py
2017-02-27 13:13:46 -07:00
Calle Pettersson
6dac1c710e Vault: Add support for expanding lists in policies 2017-02-27 19:55:26 +01:00
Mike Place
b6dea5efb9
Correct small bug with docs test. 2017-02-27 09:59:25 -07:00
Mike Place
3336dbc02a Merge pull request #39660 from terminalmage/warn_ip_addrs
Add warnings to test suite when requisites are not installed
2017-02-27 09:55:38 -07:00
dharper
c71753197a Checking instance exists in master._get_cached_minion_data when cache.fetch returns None 2017-02-27 09:37:37 -06:00
Erik Johnson
5a3c099e4f Rewrite the tests_valid_docs test
This uses a function in the runtests_helpers custom module to perform
all the logic, and only returns what failed the test. This saves us from
having to return the entire contents of sys.doc (as well as log all of
the function calls), and also removes the need to run sys.doc in batches
to get around the "max message size" issue.
2017-02-26 12:21:00 -06:00
Erik Johnson
c7dfb494a6 Fix mocking for grains refresh 2017-02-25 21:04:48 -06:00
Erik Johnson
9f6d08d606 Update tests which used string kwargs 2017-02-25 20:11:06 -06:00
Erik Johnson
503216e5c5 Add warnings to test suite when requisites are not installed
Since we have recently changed the test suite to use new-style
git_pillar, GitPython or Pygit2 is a hard dep for the test suite.

Additionally, when starting up the daemons, if no IPv4 addresses can be
detected (which can happen on docker containers which tend to have
minimal installs) then the suite will time out trying to detect whether
or not the minion/sub-minion has connected, which while it does not
prove fatal for the test suite, it does make the suite take several
minutes to start up and begin running tests. This is because the test
suite invokes the manage.joined runner, which in turn invokes
salt.utils.network.ip_addrs() to get the system's IP addresses to match
against those which are connected. If it can't get the IP addresses,
then the manage.joined runner returns an empty list, and the test suite
believes that no minions have connected, and the function that
periodically runs manage.joined will eventually time out.

This commit adds messages to the console when no suitable gitfs provider
is installed, and when salt.utils.network.ip_addrs() returns an empty
list, to hopefully prompt the user to install the missing requisites.
2017-02-25 19:49:44 -06:00
Seth House
d11f5381a4 Add RunnerClient test for old/new-style arg/kwarg parsing 2017-02-24 22:40:59 -07:00
Seth House
ec377ab379 Reenable skipped RunnerClient tests
I think these were skipped erroneously or perhaps whatever the problem
was has since been resolved.
2017-02-24 22:40:59 -07:00
twangboy
7f79683691 Add to the whitelist 2017-02-24 15:31:55 -07:00
twangboy
f43445d3de Fix test_rendering_includes for Windows 2017-02-24 15:28:03 -07:00
Erik Johnson
28564da966 Implement no_block for service.running/service.dead (systemd only) 2017-02-24 15:14:09 -06:00
Mike Place
9eb23993d3 Merge pull request #39467 from gtmanfred/sls_build
Use sls_build for building docker images
2017-02-24 14:04:38 -07:00
Daniel Wallace
89101fa342 allow sls_build to be used with states 2017-02-24 11:47:13 -06:00
twangboy
34659761e8 Add issue number to skipIf 2017-02-24 09:31:47 -07:00
twangboy
e50ae8dd37 Fix wheel tests 2017-02-24 09:31:47 -07:00
Pedro Algarvio
0e1e133169
Fix a weird import issue
```
ImportError: Failed to import test module: unit.modules.docker_test
Traceback (most recent call last):
  File "/usr/lib64/python2.7/unittest/loader.py", line 252, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/lib64/python2.7/unittest/loader.py", line 230, in _get_module_from_name
    __import__(name)
  File "/testing/tests/unit/modules/docker_test.py", line 39, in <module>
    class DockerTestCase(TestCase):
  File "/testing/tests/unit/modules/docker_test.py", line 103, in DockerTestCase
    @skipIf(_docker_py_version() < (1, 4, 0),
  File "/testing/tests/unit/modules/docker_test.py", line 34, in _docker_py_version
    return docker_mod.docker.version_info
AttributeError: 'module' object has no attribute 'version_info'
```
2017-02-24 09:11:23 +00:00
Pedro Algarvio
1b84bee06f
Enforce and preserve module loading order.
This is the only way we can have predictable results when overriding,
for example, grains.
2017-02-24 09:11:22 +00:00
Pedro Algarvio
f9015ff1e4
Don't even try to concatenate non string types 2017-02-24 09:11:21 +00:00
Erik Johnson
ca54541abe Add missing unit test for disable func 2017-02-24 01:12:42 -06:00
Pedro Algarvio
62f55073c9
Fix test cases(no longer logging errors). 2017-02-24 00:49:33 +00:00
Pedro Algarvio
15376697f9
Code cleanup 2017-02-24 00:49:33 +00:00
Pedro Algarvio
5d0110d98b
Code cleanup 2017-02-24 00:49:33 +00:00
Pedro Algarvio
ae46b0da3a
Code cleanup 2017-02-24 00:49:32 +00:00
Pedro Algarvio
3a85996d2a
Code cleanup 2017-02-24 00:49:32 +00:00
Pedro Algarvio
f7974b186b
Code cleanup 2017-02-24 00:49:32 +00:00
Pedro Algarvio
7fff27627a
Code cleanup 2017-02-24 00:49:32 +00:00
Pedro Algarvio
5fb0aa5dcf
Code cleanup 2017-02-24 00:49:31 +00:00