Commit graph

60 commits

Author SHA1 Message Date
Daniel A. Wozniak
19669adde2 Fix broken gitfs ssh tests on nightly builds 2024-06-10 19:42:21 -07:00
Pedro Algarvio
03ad4c6337 Update code to be Py3.7+ to reduce merge forward conflicts 2024-02-29 10:16:58 +00:00
Daniel A. Wozniak
afb794a7e4 test fix 2024-02-28 16:49:31 -07:00
Pedro Algarvio
866ded4a30 The TestGitPython*HTTP and TestPygit2*HTTP tests now use a container
Instead of installing uwsgi and setting up nginx when running the test suite

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-29 09:12:09 +00:00
Pedro Algarvio
3afaeb50bd Skip if the nginx binary cannot be found
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-06 06:03:10 +00:00
Pedro Algarvio
f0ce8c0b28 The newer Opensuse golden image has git-core in /usr/share
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-12-06 06:03:10 +00: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
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
Gareth J. Greenaway
697bb60866 removing extra newlines. 2022-02-18 12:12:58 -05:00
Gareth J. Greenaway
dd0ed4ab85 Removing any changes related to changing permissions. This is handled when we build the golden images for tests. 2022-02-18 12:12:58 -05:00
Gareth J. Greenaway
00ee5eed1d various changes and fixes needed to add PhotonOS into CICD. 2022-02-18 12:12:58 -05:00
Pedro Algarvio
5fa698d8b5 Fix lint 2021-09-22 14:01:19 -04:00
Pedro Algarvio
6abb43d2df Upgrade to black 21.7b0 2021-08-06 13:09:47 -07:00
Pedro Algarvio
aef8fdc3d3 Bump to pytest-salt-factories >= 0.903.x 2021-05-28 14:48:59 -07: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
0aba49c7d3
Bump pytest-salt-factories to 0.92.x 2020-09-14 07:55:09 +01:00
Pedro Algarvio
3ab6b9dca2
Use PyTest fixtures for the Git Pillar tests 2020-09-14 07:36:37 +01:00
Pedro Algarvio
c06f77dd2b
Bump pytest-salt-factories to 0.11.x 2020-09-02 12:34:05 +01:00
krionbsd
6a2b243029 Fix broken slow and destructive tests on FreeBSD 2020-08-07 11:31:37 -07:00
Pedro Algarvio
ef9237e056 Upgrade to pytest-salt-factories 0.10.x 2020-05-07 16:00:11 -07:00
Pedro Algarvio
ad95cd4c47 Update to saltfactories v0.7.14 2020-05-07 16:00:11 -07:00
Pedro Algarvio
113effec7b Fix non salt daemons support 2020-05-07 16:00:11 -07:00
Pedro Algarvio
e157459016 Switch to pytest-salt-factories 2020-05-07 16:00:11 -07:00
Benjamin Drung
1bcf426811 Add gitfs and git_pillar fallback branch
Add a fallback branch when no matching branch is found. Example:

```yaml
gitfs_remotes:
  - http://foo.com/states/top.git:
    - all_saltenvs: master
  - http://foo.com/states/apache.git:
    - fallback: master
  - http://foo.com/states/nginx.git:
    - fallback: master
  - http://foo.com/states/webapp.git:
    - fallback: develop
```

Where a state in `webapp` includes a state of `apache`.

With this change, one can test a feature branch of `webapp` without
needing to create the same branch in `apache`. Similarly, one can test a
feature branch of `apache` without needing to create the same branch in
`webapp`.

This is a forward port of pull request #51971 from Mathieu Parent.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-15 13:20:32 +02:00
Blacken Salt
0b2a5613b3
Blacken salt 2020-04-03 13:05:41 -05:00
Pedro Algarvio
b343e4bd5c
Reset the class variables on tearDownClass 2019-12-11 16:02:55 +00:00
Pedro Algarvio
d549a8f82a
Lint fixes 2019-12-06 12:48:18 +00:00
Pedro Algarvio
62fbf2f14a
Make sure the environ is reset no matter what 2019-12-06 08:34:22 +00:00
Pedro Algarvio
8525b0de18
Lint fixes 2019-11-14 11:12:21 +00:00
Pedro Algarvio
561c0a2317
Have the started processes log instead of just writing to stdout/stderr 2019-08-29 19:40:18 +01:00
Pedro Algarvio
4eb85fac6f
Skip tests on RHEL family < 7 2019-08-22 06:56:00 +01:00
Pedro Algarvio
d0f8efae3c
Don't keep recreating the git repos. Restore from backup. 2019-08-22 06:56:00 +01:00
Pedro Algarvio
6114e9dcd9
All prep work is done in setUpClass.
Additionally, make sure `tearDownClass` always runs in case of failures
in `setUpClass`.
2019-08-22 06:55:59 +01:00
Pedro Algarvio
5b030dd702
Daemons are now started/stopped on tests, not by salt 2019-08-22 06:55:59 +01:00
Pedro Algarvio
ed60f0d17e
We don't actually need grains 2019-08-22 06:55:59 +01:00
Ch3LL
347ea1e979
Use Sigkill and add time.sleep befor check 2019-07-24 14:33:01 -04:00
Ch3LL
c0be14760d
Send SIGTERM webserver during teardown of gitfs tests 2019-07-22 18:09:41 -04:00
Ch3LL
b776c0c15b
Check if gitfs server fails to setup for tests 2019-07-22 16:02:46 -04:00
Pedro Algarvio
da2e147e54
Always cleanup the changed environ 2019-05-09 14:13:32 +01:00
Pedro Algarvio
62574ee197
Typo 2019-05-08 13:16:52 +01:00
Daniel A. Wozniak
522599d261
Dont fail just because some random process died 2019-05-08 13:16:47 +01:00
Mathieu Parent
12ea1cc01e
git_pillar: Add tests for mountpoint parameter
(cherry picked from commit 6e2f4e471d)
2018-11-16 06:07:24 +01:00
Mathieu Parent
fce467e438
git_pillar: Add tests for root parameter
(cherry picked from commit 2e88b74816)
2018-11-16 06:07:24 +01:00
Mathieu Parent
ba150a5182
Don't fail on git_pillar tests when destructive tests are not enable
This fixes the following when running `python tests/runtests.py --ext-pillar`:

 --------  Tests with Errors  ------------------------------------------------------------------------------------------------------------------------
   -> tearDownClass (integration.pillar.test_git_pillar.TestGitPythonSSH)  ...........................................................................
       Traceback (most recent call last):
         File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
           if cls.case.sshd_proc is not None:
       AttributeError: 'NoneType' object has no attribute 'sshd_proc'
   ...................................................................................................................................................
   -> tearDownClass (integration.pillar.test_git_pillar.TestPygit2SSH)  ..............................................................................
       Traceback (most recent call last):
         File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
           if cls.case.sshd_proc is not None:
       AttributeError: 'NoneType' object has no attribute 'sshd_proc'
   ...................................................................................................................................................
 -----------------------------------------------------------------------------------------------------------------------------------------------------

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
(cherry picked from commit 84e9fce9bb)
2018-11-16 06:07:22 +01:00
Pablo Suárez Hernández
b7af5e52c5
Test git ext_pillar across multiple repos using __env__ 2018-11-07 16:33:03 +00:00
rallytime
201031fa8a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - 	doc/man/salt.7
  - 	doc/ref/configuration/minion.rst
  - 	salt/cloud/clouds/ec2.py
  - 	salt/returners/highstate_return.py
  - 	tests/support/gitfs.py
  - 	tests/unit/loader/test_loader.py
2018-08-10 13:12:14 -04:00
Erik Johnson
0441cd56ef
Add optimization_order to mocking 2018-08-08 11:22:52 -05:00
Erik Johnson
1dc6e79638
[PY3] Add unicode_literals to ext_pillar modules 2018-01-04 08:46:40 -06:00
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
Erik Johnson
8b16300495
Fix some regressions in recent legacy git_pillar deprecation
These didn't get caught in PR 42823 because of how we invoke the
git_pillar code. Firstly, the "pillar" argument needed to stay. This is
because even though we're not using it, _external_pillar_data() is still
passing it now that git_pillar is not specially invoked there.
Secondly, since the input comes in as a list, and _external_pillar_data
uses single-asterisk expansion, the repos are passed separately when
they should be passed as a single list. To fix these issues, I've done
the following:

1. Re-introduced the "pillar" argument in git_pillar's ext_pillar
   function.
2. Changed the "pillar" variable to avoid confusion with the (unused)
   "pillar" argument being passed in.
3. Instead of git_pillar accepting the repos as a list, the ext_pillar
   function now uses single-asterisk expansion to make it conform with
   how _external_pillar_data() invokes it.
2017-09-26 16:12:55 -05:00