Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several improvements required to test salt against artifact packages #134

Merged
merged 9 commits into from
Jul 14, 2022

Conversation

s0undt3ch
Copy link
Contributor

@s0undt3ch s0undt3ch commented Jul 13, 2022

  • Renamed all occurrences of system_install to system_service.
  • Add --system-service CLI flag support.
  • Allow passing --python-executable
  • Allow passing --scripts-dir to tell salt-factories where to look for scripts
  • Revert "Use salt's entry-points instead of relying on loader *_dirs configs"
  • Add system_service tests

Closes #96
Closes #129
Closes #130
Closes #131
Closes #133

Renamed the ``system_install`` configuration flag, markers and behaviours when set to ``system_service`` to better reflect what it's actually used for.

Fixes saltstack#96

Signed-off-by: Pedro Algarvio <[email protected]>
Added CLI support(``--system-service``) to change salt-factories to use Salt previously installed from the platform's package manager.

Fixes saltstack#131

Signed-off-by: Pedro Algarvio <[email protected]>
This allows tweaking which python get's used to prefix CLI commands, when needed.

Fixes saltstack#129

Signed-off-by: Pedro Algarvio <[email protected]>
…for scripts

The several scripts to the Salt daemons and CLI's **must** exist. Also, passing this option will additionally make
salt-factories **NOT** generate said scripts and set ``python_executable`` to ``None``.

Fixes saltstack#130

Signed-off-by: Pedro Algarvio <[email protected]>
@s0undt3ch s0undt3ch force-pushed the master branch 2 times, most recently from 5d56a7d to 52ac4ed Compare July 13, 2022 16:45
…`` configs"

This reverts commit 52050f6.

Additionally, only inject ``engines_dirs`` and ``log_handlers_dirs`` when ``system_service=True`` or ``scripts_path`` is not ``None``.

These flags suggest that the salt being imported and used by salt-factories might not be the same as the one being tested.
So, in this case, make sure events and logging from started daemons still get forwarded to salt-factories.

Fixes saltstack#133
Signed-off-by: Pedro Algarvio <[email protected]>
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #134 (80b6d3a) into master (113e8c6) will increase coverage by 0.20%.
The diff coverage is 75.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   85.87%   86.07%   +0.20%     
==========================================
  Files          95       96       +1     
  Lines        5504     5568      +64     
  Branches      621      624       +3     
==========================================
+ Hits         4726     4792      +66     
- Misses        591      597       +6     
+ Partials      187      179       -8     
Flag Coverage Δ
Linux 85.40% <75.17%> (+0.21%) ⬆️
Py35 67.74% <41.85%> (-0.39%) ⬇️
Py36 84.69% <73.76%> (+0.21%) ⬆️
Py37 84.97% <73.76%> (+0.21%) ⬆️
Py38 85.34% <75.17%> (+0.21%) ⬆️
Py39 85.36% <75.17%> (+0.21%) ⬆️
PyTest61 69.15% <44.97%> (-0.36%) ⬇️
PyTest62 85.55% <75.17%> (+0.21%) ⬆️
PyTest70 85.58% <75.17%> (+0.21%) ⬆️
PyTest71 85.58% <75.17%> (+0.21%) ⬆️
Windows 76.35% <47.52%> (-0.36%) ⬇️
macOS 77.69% <73.05%> (+0.31%) ⬆️
src 78.77% <52.00%> (+0.12%) ⬆️
tests 95.73% <98.65%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/saltfactories/daemons/syndic.py 73.78% <0.00%> (ø)
src/saltfactories/plugins/markers.py 100.00% <ø> (ø)
...gration/factories/daemons/container/test_minion.py 90.70% <0.00%> (ø)
tests/unit/factories/base/test_salt_cli_factory.py 100.00% <ø> (ø)
tests/unit/factories/cli/test_salt.py 96.43% <ø> (-0.06%) ⬇️
tests/unit/factories/cli/test_salt_cp.py 100.00% <ø> (ø)
tests/unit/factories/cli/test_salt_run.py 100.00% <ø> (ø)
src/saltfactories/bases.py 77.25% <25.00%> (+0.40%) ⬆️
src/saltfactories/manager.py 80.62% <33.34%> (-8.67%) ⬇️
src/saltfactories/daemons/minion.py 81.25% <50.00%> (+1.25%) ⬆️
... and 16 more

Signed-off-by: Pedro Algarvio <[email protected]>
Signed-off-by: Pedro Algarvio <[email protected]>
@s0undt3ch s0undt3ch merged commit a28729e into saltstack:master Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment