Commit Graph

61 Commits

Author SHA1 Message Date
Erik Johnson
3881b6e0f3 Prepare git_pillar test code for adding HTTP tests
This further abstracts some of the setup and teardown code so it can be
used for git-over-http tests.

It also moves the code that was originally added to the archive
state integration tests to create a local http server into
salt.support.helpers so that it can be more easily and portably used.
2017-04-24 11:00:39 -05:00
Pedro Algarvio
eb588c772a
Add missing futures import 2017-04-05 23:16:52 +01:00
Pedro Algarvio
cd1f7ba629
Let's use the system temp dir as it was to see if it fixes the test failure 2017-04-05 00:34:39 +01:00
Pedro Algarvio
c3417213d7
Make sure the socket's used are closed 2017-04-04 19:28:06 +01:00
Pedro Algarvio
61003bca0a
Take care of resource leakage on tests 2017-04-04 18:58:20 +01:00
Pedro Algarvio
42e35e13cc
Use mock to patch 2017-04-04 18:58:20 +01:00
Pedro Algarvio
008f0016e2
Make sure we close the spooled temporary file 2017-04-04 18:58:19 +01:00
Pedro Algarvio
104a2fb30c
Keep the same exception raised before the move 2017-04-04 18:04:39 +01:00
Pedro Algarvio
6a638620ba
Move base test case modules to tests.support.case 2017-04-04 18:04:39 +01:00
Pedro Algarvio
9af2ca8823
No need to load all modules docs.
This should reduce memory usage as well as speeding up the decorator
2017-04-04 18:04:38 +01:00
Pedro Algarvio
b94992f544
Some more RUNTIME_CONFIGS and RUNTIME_VARS fixes 2017-04-04 18:04:38 +01:00
Pedro Algarvio
8031ac0209
Move mixins to tests.support.mixins.
The adapted config mixin get config methods are not static methods
2017-04-04 17:29:34 +01:00
Pedro Algarvio
8056479853
This argument is not required when used as a ctx manager 2017-04-01 14:26:11 +01:00
Pedro Algarvio
174625618a
Add mixin to assert XML equality 2017-04-01 14:22:58 +01:00
Pedro Algarvio
9a11538b54
Stop using deprecated TestCase methods 2017-04-01 14:22:57 +01:00
Pedro Algarvio
9cf1b37b54
Take care of some more deprecated TestCase methods 2017-04-01 14:22:57 +01:00
Pedro Algarvio
f82fa73fd7
Pylint disable 2017-04-01 14:22:55 +01:00
Pedro Algarvio
090041d674
Allow patching sys.modules with mocked modules 2017-03-28 19:04:04 +01:00
Pedro Algarvio
7c9460b719
Reduce complexity while still allowing multiple loader modules to be mocked
This also goes in par with the effort to reduce memory usage since we no
longer have any class attributes attached to the test classes.
2017-03-28 19:02:51 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
30f62f22ec
Simplify the mock mixin required work
This approach does not require the user to call `super().setUp()`
2017-03-28 19:00:51 +01:00
twangboy
72cb96a642 Fix parser for windows... again... 2017-03-23 12:24:26 -06:00
twangboy
fd4beaa856 Use Py2 check instead of Py3 check 2017-03-22 13:51:52 -06:00
twangboy
9c8ad6d365 Detect py3 before decode 2017-03-22 13:37:50 -06:00
twangboy
8eefbe8111 Decode test names in names-file 2017-03-21 17:12:18 -06:00
Pedro Algarvio
6fe53339ce
Gate class definitions 2017-03-11 19:46:23 +00:00
Pedro Algarvio
992a8c7294
Don't hardcode the webserver port number 2017-03-11 16:00:28 +00:00
Pedro Algarvio
0cb46f0eb8
Several enhancements to the mocked loader module mixin
Allows patching more than one loader module.
Allows auto-loading the minion functions which will get namespaced with
the globals used to patch the loader module(s).
2017-03-09 19:31:15 +00:00
Pedro Algarvio
dd53f055b9
Code cleanup and make sure the beacons config file is deleted after testing 2017-03-09 19:29:16 +00:00
Pedro Algarvio
a429b652dc
Proxy the .fileno() method.
This avoids tracebacks when daemonizing code which is running under the XMLRunner:
```
23:22:46 Traceback (most recent call last):
23:22:47   File "/testing/salt/utils/process.py", line 644, in _run
23:22:47     return self._original_run()
23:22:47   File "/usr/lib64/python3.4/multiprocessing/process.py", line 93, in run
23:22:47     self._target(*self._args, **self._kwargs)
23:22:47   File "/testing/salt/client/mixins.py", line 464, in _proc_function
23:22:47     salt.utils.daemonize()
23:22:47   File "/testing/salt/utils/__init__.py", line 502, in daemonize
23:22:47     os.dup2(dev_null.fileno(), sys.stdout.fileno())
23:22:47 io.UnsupportedOperation: fileno
23:22:47 Process SignalHandlingMultiprocessingProcess-2:
23:22:47 Traceback (most recent call last):
23:22:47   File "/usr/lib64/python3.4/multiprocessing/process.py", line 254, in _bootstrap
23:22:47     self.run()
23:22:47   File "/testing/salt/utils/process.py", line 644, in _run
23:22:47     return self._original_run()
23:22:47   File "/usr/lib64/python3.4/multiprocessing/process.py", line 93, in run
23:22:47     self._target(*self._args, **self._kwargs)
23:22:47   File "/testing/salt/client/mixins.py", line 464, in _proc_function
23:22:47     salt.utils.daemonize()
23:22:47   File "/testing/salt/utils/__init__.py", line 502, in daemonize
23:22:47     os.dup2(dev_null.fileno(), sys.stdout.fileno())
23:22:47 io.UnsupportedOperation: fileno
```
2017-03-09 19:29:16 +00:00
Pedro Algarvio
0a66eac8ad
Ditch initial double forward slashes 2017-03-08 18:34:35 +00:00
Pedro Algarvio
c09f5e49ff
Absolute paths 2017-03-08 18:34:34 +00:00
Pedro Algarvio
36b18864e5
Reuse the existing tests support paths module 2017-03-08 18:34:34 +00:00
Pedro Algarvio
70c0a10666
Properly handle bytes 2017-03-08 18:34:33 +00:00
Pedro Algarvio
ff3faf56fb
Catch AttributeError 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
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
0604fdeb8b
Don't warn if the attributes are set to None 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
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
140b97ee8b
We need __version__ in the tests.support.mock scope 2017-03-06 14:35:12 +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
cb293f2f6d Merge pull request #39649 from s0undt3ch/features/py3
Moar Py3
2017-03-02 21:16:51 +00:00
Pedro Algarvio
5e3309d5f8
Let's use the skip_if_not_root decorator instead 2017-03-02 19:58:10 +00:00