Commit graph

37 commits

Author SHA1 Message Date
Pedro Algarvio
4aad0d2e37 Annotate the sources instead of commenting on the PR
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-01-13 16:08:08 +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
Gary T. Giesen
ec82fcba3c Update 'MISSING_EXAMPLES' in pre-commit docstrings task 2022-06-02 12:16:30 -06:00
Gary T. Giesen
01b3dced33 Fix grammar because it's driving me crazy 2022-06-01 07:30:17 -06:00
Pedro Algarvio
3d73e90796 Move the salt loader `log_handlers` out of the internal logging package
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-04-12 09:46:02 -04:00
Wayne Werner
deeeaa3cd3
Cache API tests & unifying behavior (#61229)
* Add tests for cache backends

* Tests run against everything!

* Get consul passing cache tests

* now mysql tests also pass

* comments

* add mysql cache tests

* Ensure consul cache is flushing timestamp keys

* Ensure etcd cache is flushing timestamp keys

* Update redis cache api to conform to localfs

There was a bug in some of the lookups where it was looking at sub banks
instead of the banks containing the leaf/key nodes. That was fixed. Also
restored the original behaviors, only adding the updated functionality,
namely adding timestamp key/values to redis.

* Fix etcd path inconsistency

Previously on X-Files. Wait nope. Previously on etcd cache files...
😂 if a path were 1/2/3 then etcd would break with IndexError, but
when it was 1/2/3/4/5 then instead of returning the "file" (key?) 5 it
would return `4/5` as the name. Which is probably not correct, and
definitely inconsistent with localfs (and every other cache module).

Now it will always only return the final segment of the cache (e.g. 7
for 1/2/3/4/5/6/7 and 5 for 1/2/5)

* Remove comments and cleanup test setup

Comments were outdated, now they're gone or fixed. Also shifted around
some of the test setup to make it a bit cleaner.

* Add localfs backed memcache to the tests

Fixed an inconsistency when flushing banks with None key. Also added
to the test run. We may want to add other backing caches via alternate
fixtures?

* Bad serial

* No this is wrong

* Probably the right lazy loader fix

* Restore tested mysql cache functionality

Added a force_reconnect function because I couldn't figure out how to
remove the client from the context any other way. There may be a better
way to do that, but there will probably be some loader changes anyway.

* remove silly files

Saltfile never should have been added in the first place and the
integration test wasn't really necessary, functional was better/lighter.

* Fix redis_cache cluster mode import

Fixes #60272 - the import statement was totally incorrect. Now it will
actually attempt to connect to a redis cluster.

* payload should string-ify all the data

* Fix unit tests for parametrization

From what I can tell, previously the query was being built in Python
instead of using mysql to add the parameters, and this probably horked
up the handling of binary strings.

Unless some other version of the DB will be problematic...

* Fix missing docstring complaints

* incorporate PR feedback

* Skip docker if not found and add the rest of mysql

I really really hate the way this is configured but I can't make pytest
use fixtures as parameters in fixtures. I may have to struggle to come
up with another way.

* Tests all passing, woo!

* run black

* Disable pylint here

* Skip when mysql fails during CI

This has been tested locally and it runs all of them. I'm sure with the
CI environment it's possible that it fails for no particularly good
reason. And it's definitely not worth blocking a PR for (though arguably
it could be if *all* of the images fail, but...)
2022-04-08 09:18:38 -04:00
Pedro Algarvio
7414b5eb16 Catch exceptions while reading and state which file caused the error
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-04-08 09:14:01 -04:00
HerHde
7e9a8362e2 Add missing docstrings 2022-03-08 15:44:29 -05:00
Pedro Algarvio
f2a783643d Update to latest `pyupgrade` hook. Stop skipping it on CI.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-01-26 15:18:32 -08:00
Pedro Algarvio
5d75291845 Don't fail on known doc failures 2021-08-19 07:31:52 -04:00
Pedro Algarvio
3dc2834bfa Docstring auto fixes are now done by salt-rewrite 2021-08-19 07:31:52 -04:00
Pedro Algarvio
26fbfc96dc Compile regexes once 2021-08-19 07:31:52 -04:00
Pedro Algarvio
9e1b51478c Catch some more badly formatted version added/changed/deprecated directives 2021-08-19 07:31:52 -04:00
Pedro Algarvio
241f677fff Always include a blank line before CLI Example: 2021-08-19 07:31:52 -04:00
Pedro Algarvio
7bb8989ab8 versionadded, versionchanged, deprecated versions should not be v prefixed 2021-08-19 07:31:52 -04:00
Pedro Algarvio
4245c40cef Automatically replace version names by version numbers 2021-08-19 07:31:52 -04:00
Pedro Algarvio
06e111ff0a Allow adding missing .. code-block:: bash on examples where its simple to do so 2021-08-19 07:31:52 -04:00
Pedro Algarvio
2c973716c1 Fix simple spacing and capitalization issues on CLI examples 2021-08-19 07:31:52 -04:00
Pedro Algarvio
5ab05cb95e Minor fixes to the docstrings task 2021-08-19 07:31:52 -04:00
Pedro Algarvio
992c6dcda4 Autofix code-block directives 2021-08-19 07:31:52 -04:00
Pedro Algarvio
510cd92a2e Add auto formatting for sphinx directives 2021-08-19 07:31:52 -04:00
Pedro Algarvio
aeb87a60fb Group versionadded, versionchanged, deprecated checks in a single function
Refs #58208
Refs #59077
Refs #59083
2021-08-19 07:31:52 -04:00
Pedro Algarvio
f61c19a6f6 Also check for proper versionchanged versions
Refs #59083
2021-08-19 07:31:52 -04:00
Pedro Algarvio
d77f3ef36b Also check for proper versionadded versions
Refs #59077
2021-08-19 07:31:52 -04:00
Pedro Algarvio
5f62e0b312 Don't enforce the presence of __virtualname__ yet 2021-08-19 07:31:52 -04:00
Pedro Algarvio
ba177ad738 Check loader modules __virtual__ and salt/modules/*.py with pre-commit
Fixes #58537
2021-08-19 07:31:52 -04:00
Pedro Algarvio
76e50885b0 Fix strings 2021-08-06 13:09:47 -07:00
Daniel A. Wozniak
d9b50659b2 Pyupgrade and drop six 2021-07-06 09:04:28 -04:00
Pedro Algarvio
b5b6f24367 Only run check-docs on deleted files on CI.
The hook fails when we delete a module and don't delete the corresponding docs

This is a slow hook to run locally.
2021-03-02 08:42:19 -05:00
Pedro Algarvio
5f4ed3b3f4 Allow running the pre-commit jenkins job in GH Actions 2020-11-30 14:20:56 -07:00
Pedro Algarvio
7e7cbf3ffa
Switch to the remove-import-headers pre-commit hook 2020-10-07 10:46:20 +01:00
Pedro Algarvio
65e12043eb Automatically remove import comments on files.
This is desired because now imports are automatically sorted and these
header comments often get misplaced.

Fixes #57979
2020-09-24 13:47:43 -07:00
Pedro Algarvio
e6e1ab3ef6 Add task to check tests/filename_map.yml validity 2020-05-19 10:18:24 -07:00
Pedro Algarvio
dfddc15569
Resolve paths passed directly with --files 2020-04-24 07:53:38 +01:00
Pedro Algarvio
f6c2355f33
Add loader checks although not currently enforcing them 2020-04-23 20:01:05 +01:00
Pedro Algarvio
6a4703146c
Replace tests/unit/test_doc.py with a pre-commit hook.
We don't need to test docs on all platforms. In turn, we make the check
a pre-commit hook which seems more suited.
2020-04-23 20:01:05 +01:00
Pedro Algarvio
a5b9961f78
Lay the ground for invoke usage 2020-04-23 18:42:47 +01:00