Commit graph

167 commits

Author SHA1 Message Date
David Murphy
e8441238e1 Initial removal usage of distutils and replacement with setuptools 2022-12-20 07:07:21 -07:00
Pedro Algarvio
7af30ff1bd Replace the usage of @runs_on(...) and @not_runs_on(...)
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-06 06:03:10 +00:00
Pedro Algarvio
8a769342d6 Remove tests code/skips targeted for Py<3.6
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-06 06:03:10 +00:00
Pedro Algarvio
1882be04ed change_cwd is not a pytest helper function
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-02 11:19:30 +00:00
Pedro Algarvio
3012dc42d6 Test fixes when running with the onedir build
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-08-29 13:24:21 -07:00
MKLeb
1ccf96f633 move Keys class to test helpers for ease of reuse 2022-08-10 10:37:04 -06:00
Pedro Algarvio
b35e7d46dc Format source code using latest black
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-08-01 12:49:16 -06:00
Pedro Algarvio
4d49013247 Update to isort 5.10.1
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-08-01 12:49:16 -06:00
Pedro Algarvio
ab9def79b6 Windows seems to struggle with this check when collecting tests.
```
tests\unit\modules\inspectlib\test_collector.py:27: in <module>
    @skipIf(no_symlinks(), "Git missing 'core.symlinks=true' config")
        Inspector  = <class 'salt.modules.inspectlib.collector.Inspector'>
        MagicMock  = <class 'mock.mock.MagicMock'>
        TestCase   = <class 'tests.support.unit.TestCase'>
        __builtins__ = <builtins>
        __cached__ = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\__pycache__\\test_collector.cpython-38.pyc'
        __doc__    = '\n    :codeauthor: Bo Maryniuk <bo@suse.de>\n'
        __file__   = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\test_collector.py'
        __loader__ = <_pytest.assertion.rewrite.AssertionRewritingHook object at 0x0000022B0C3A6B20>
        __name__   = 'tests.unit.modules.inspectlib.test_collector'
        __package__ = 'tests.unit.modules.inspectlib'
        __spec__   = ModuleSpec(name='tests.unit.modules.inspectlib.test_collector', loader=<_pytest.assertion.rewrite.AssertionRewritingHo...C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\test_collector.py')
        no_symlinks = <function no_symlinks at 0x0000022B0D05CC10>
        os         = <module 'os' from 'c:\\python38\\lib\\os.py'>
        patch      = <function patch at 0x0000022B2836FB80>
        skipIf     = <function skipIf at 0x0000022B270738B0>
tests\support\helpers.py:82: in no_symlinks
    output = subprocess.Popen(
        output     = ''
c:\python38\lib\subprocess.py:858: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
        args       = ['git', 'config', '--get', 'core.symlinks']
        bufsize    = -1
        c2pread    = 5
        c2pwrite   = Handle(2176)
        close_fds  = True
        creationflags = 0
        cwd        = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\salt-tests-tmpdir'
        encoding   = None
        env        = None
        errors     = None
        errread    = -1
        errwrite   = Handle(2196)
        executable = None
        f          = <_io.BufferedReader name=5>
        p2cread    = Handle(1984)
        p2cwrite   = -1
        pass_fds   = ()
        preexec_fn = None
        restore_signals = True
        self       = <subprocess.Popen object at 0x0000022B3012E400>
        shell      = False
        start_new_session = False
        startupinfo = None
        stderr     = None
        stdin      = None
        stdout     = -1
        text       = None
        universal_newlines = None
c:\python38\lib\subprocess.py:1311: in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
E   NotADirectoryError: [WinError 267] The directory name is invalid
        args       = 'git config --get core.symlinks'
        attribute_list = {'handle_list': [1984, 2196, 2176]}
        c2pread    = 5
        c2pwrite   = Handle(2176)
        close_fds  = False
        creationflags = 0
        cwd        = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\salt-tests-tmpdir'
        env        = None
        errread    = -1
        errwrite   = Handle(2196)
        executable = None
        handle_list = [1984, 2196, 2176]
        have_handle_list = False
        p2cread    = Handle(1984)
        p2cwrite   = -1
        pass_fds   = ()
        preexec_fn = None
        self       = <subprocess.Popen object at 0x0000022B3012E400>
        shell      = False
        startupinfo = <subprocess.STARTUPINFO object at 0x0000022B2F5E54C0>
        unused_restore_signals = True
        unused_start_new_session = False
        use_std_handles = True
```

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-22 07:24:35 +01:00
Pedro Algarvio
c708d1929b Support using `Webserver` as a context manager 2022-06-13 13:14:51 -06:00
Pedro Algarvio
29b6fe207c Updates required for `pytest-salt-factories>=1.0.0rc16`
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-06-02 07:05:09 -06:00
Pedro Algarvio
a9d5e75b52 Add the new refactored salt logging.
It also handles multiprocessing logging.
2022-04-12 09:46:02 -04:00
Pedro Algarvio
899d1392df Skip tests failing on PhotonOS until we fix them all
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-02-22 14:28:54 +00:00
Benjamin Drung
bf15a820b1 Fix spelling mistake of function
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-10-13 14:51:41 -04:00
Pedro Algarvio
ed3e86dd06 Allow uninstalling packages from the virtualenv 2021-08-27 07:21:24 -04:00
Pedro Algarvio
dde35501cd Same pip constrains as `noxfile.py` 2021-08-19 07:31:52 -04:00
Pedro Algarvio
af70f34200 `SaltVirtualEnv will always use USE_STATIC_REQUIREMENTS=1` 2021-08-16 08:16:06 -04:00
Pedro Algarvio
f783dbd496 Pin to `pip>=20.2.4,<21.2` on the created virtualenvs 2021-08-16 08:16:06 -04:00
Pedro Algarvio
76e50885b0 Fix strings 2021-08-06 13:09:47 -07:00
Pedro Algarvio
6abb43d2df Upgrade to black 21.7b0 2021-08-06 13:09:47 -07:00
Pedro Algarvio
1afa3565ce No string formatting in log calls 2021-07-13 11:10:20 -04:00
Pedro Algarvio
4671573207 Make sure venv_dir is always a pathlib.Path instance 2021-03-05 18:16:51 -05:00
Pedro Algarvio
25605e36aa Add tests for the loader entry points changes 2021-03-05 07:32:14 -05:00
Pedro Algarvio
67a4da02fa Turn VirtualEnv into an attrs implementation. Add SaltVirtualEnv.
Also add a few helper methods to `VirtualEnv`
2021-03-05 07:32:14 -05:00
Pedro Algarvio
4d3b4ad819 Stop forcing an older version of setuptools 2021-02-26 12:21:21 +00:00
Pedro Algarvio
c3a1221e68 Deprecate the flaky decorator 2021-02-13 13:04:29 +00:00
Pedro Algarvio
ab1726fc6e Deprecate some test decorators 2021-02-03 13:15:24 +00:00
Pedro Algarvio
63c50f6046 Drop Py2 and six on tests/support/helpers.py 2021-02-01 11:05:58 +00:00
Pedro Algarvio
87019146af We no longer need the distinction between running under PyTest or not 2021-01-29 13:55:52 -05:00
Pedro Algarvio
2ff66d2c87 Allow passing env variables to use with VirtualEnv 2021-01-27 17:46:28 +00:00
Pedro Algarvio
84fdfca253 Migrate unit.serializers to PyTest 2021-01-04 11:27:50 +00:00
Pedro Algarvio
439dd9fe9a
Upgrade pip on the created virtualenv's 2020-09-30 09:31:50 +01:00
ch3ll
08dd367ca8 Add verify_ssl to file.managed state 2020-09-25 16:26:26 -07:00
Pedro Algarvio
0aba49c7d3
Bump pytest-salt-factories to 0.92.x 2020-09-14 07:55:09 +01:00
Pedro Algarvio
b2287e4a23
Add skip decorator to use in tests that need to run under PyTest 2020-09-14 07:36:24 +01:00
Pedro Algarvio
de833885d4
Don't install setuptools >= 50.0.0 until they release something useful
https://github.com/pypa/setuptools/issues/2352#issuecomment-685046897
2020-09-01 19:41:12 +01:00
Pedro Algarvio
87c94b3490
Never use setuptools==50.0.0 2020-08-31 19:37:20 +01:00
Pedro Algarvio
705c015736
Move get_virtualenv_binary_path to tests.support.helpers 2020-08-26 18:09:15 +01:00
Pedro Algarvio
86a86e6b58
Add more insight into failures 2020-08-20 13:46:37 +01:00
Pedro Algarvio
0feff2ce4f Not an integration test. Fix test.
Moved the test in `tests/integration/utils/test_thin.py` to `tests/unit/utils/test_thin.py`.
Additionally, fixed the test to use the `VirtualEnv` helper instead of
the virtualenv module directly.

Fixes #57386
2020-05-20 15:56:55 -07:00
Dmitry Kuzmenko
82bcb20f5c Minor fix to pycrypto and update the test. 2020-05-14 16:33:02 -07:00
Pedro Algarvio
5c34e9d7d0 Wrap subprocess.run result in ProcessResult for better log format 2020-05-13 21:57:54 -07:00
Pedro Algarvio
0c73acf16c Always go back to the old cwd.
This wasn't previously happening if an exception was raised within the
context manager
2020-05-12 08:32:17 -07:00
Dmitry Kuzmenko
400e9de43b Fixed salt key management with eauth.
Properly pass minion list to wheel command in case of using eauth with
salt-key command. Test included.
2020-05-10 11:07:08 -07:00
Pedro Algarvio
743b47de51 Add helper code to run CLI commands 2020-05-07 16:00:11 -07:00
Pedro Algarvio
e157459016 Switch to pytest-salt-factories 2020-05-07 16:00:11 -07:00
Pedro Algarvio
83e0c6e929 Speed up our skip helpers 2020-05-07 13:09:02 -07:00
Wayne Werner
1e16375702 Inline our code with what unittest.case.skip does 2020-05-07 13:09:02 -07:00
Daniel A. Wozniak
675cd8db04 Handle un-ordered test decorators 2020-05-07 13:09:02 -07:00
Pedro Algarvio
2209c25bf9 Add --run-slow flag to runtests.py 2020-05-07 13:09:02 -07:00