salt-extension icon indicating copy to clipboard operation
salt-extension copied to clipboard

python 3.9.11 - 'FactoriesManager' object has no attribute 'get_salt_master_daemon'

Open ITJamie opened this issue 3 years ago • 1 comments

Clean setup of a salt-extension folder. No changes made to the code, only change to created folder is git setup and commit. default nox tests will not pass. I am assuming the built plugin repo should fully pass a nox test on the first run?

salt-extension v0.23.0

 % pip3 show salt-extension
Name: salt-extension
Version: 0.23.0
Summary: Tool to simplify the creation of a new salt extension
Home-page: https://saltproject.io
Author: Pedro Algarvio
Author-email: [email protected]
License: Apache Software License 2.0
Location: /Users/jamie/.pyenv/versions/3.9.11/lib/python3.9/site-packages
Requires: click, click-params, jinja2
Required-by:
 % nox
nox > Running session tests-3
nox > Re-using existing virtual environment at .nox/tests-3.
nox > python -m pip install --progress-bar=off wheel
nox > python -m pip install --progress-bar=off coverage==5.2
nox > python -m pip install --progress-bar=off 'salt>=3003rc1'
nox > python -m pip install -e '.[tests]'
nox > coverage erase
nox > coverage run -m pytest --rootdir /Users/jamie/git/salt-sonic-test --log-file=artifacts/runtests-20220326190926.663140.log --log-file-level=debug --show-capture=no --junitxml=artifacts/junit-report.xml --showlocals -ra -s tests/
==================================================================== test session starts ====================================================================
platform darwin -- Python 3.9.11, pytest-6.2.4, py-1.11.0, pluggy-0.13.1
tempdir: /private/tmp/saltfactories
rootdir: /Users/jamie/git/salt-sonic-test
plugins: helpers-namespace-2021.12.29, salt-factories-0.911.0, tempdir-2019.10.12
collected 3 items

tests/integration/modules/test_my_extension.py E
tests/unit/modules/test_my_extension.py .
tests/unit/states/test_my_extension.py .

========================================================================== ERRORS ===========================================================================
____________________________________________ ERROR at setup of test_replace_this_this_with_something_meaningful _____________________________________________

salt_factories = FactoriesManager(root_dir=PosixPath('/private/tmp/saltfactories'), tmp_root_dir=PosixPath('/private/tmp/saltfactories'..._extension', inject_coverage=True, inject_sitecustomize=True, cwd=None, environ=None, slow_stop=True, start_timeout=60)

    @pytest.fixture(scope="package")
    def master(salt_factories):
>       return salt_factories.get_salt_master_daemon(random_string("master-"))
E       AttributeError: 'FactoriesManager' object has no attribute 'get_salt_master_daemon'

salt_factories = FactoriesManager(root_dir=PosixPath('/private/tmp/saltfactories'), tmp_root_dir=PosixPath('/private/tmp/saltfactories'..._extension', inject_coverage=True, inject_sitecustomize=True, cwd=None, environ=None, slow_stop=True, start_timeout=60)

tests/conftest.py:23: AttributeError
-------------------------------------- generated xml file: /Users/jamie/git/salt-sonic-test/artifacts/junit-report.xml --------------------------------------
================================================================== short test summary info ==================================================================
ERROR tests/integration/modules/test_my_extension.py::test_replace_this_this_with_something_meaningful - AttributeError: 'FactoriesManager' object has no ...
=========================================================== 2 passed, 1 error in 85.25s (0:01:25) ===========================================================
nox > Command coverage run -m pytest --rootdir /Users/jamie/git/salt-sonic-test --log-file=artifacts/runtests-20220326190926.663140.log --log-file-level=debug --show-capture=no --junitxml=artifacts/junit-report.xml --showlocals -ra -s tests/ failed with exit code 1
nox > coverage combine
nox > coverage xml -o artifacts/coverage-project.xml '--omit=tests/*' '--include=src/saltext/my_extension/*'
nox > coverage xml -o artifacts/coverage-tests.xml '--omit=src/saltext/my_extension/*' '--include=tests/*'
nox > coverage report --show-missing '--include=src/saltext/my_extension/*'
Name                                                   Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------
src/saltext/my_extension/__init__.py                       4      0      0      0   100%
src/saltext/my_extension/modules/__init__.py               0      0      0      0   100%
src/saltext/my_extension/modules/my_extension_mod.py       7      0      0      0   100%
src/saltext/my_extension/states/__init__.py                0      0      0      0   100%
src/saltext/my_extension/states/my_extension_mod.py       15      3      4      1    68%   17-19, 28->31
src/saltext/my_extension/version.py                        1      0      0      0   100%
--------------------------------------------------------------------------------------------------
TOTAL                                                     27      3      4      1    81%
nox > Session tests-3 failed.
nox > Running session tests-3.5
nox > Session tests-3.5 skipped: Python interpreter 3.5 not found.
nox > Running session tests-3.6
nox > Session tests-3.6 skipped: Python interpreter 3.6 not found.
nox > Running session tests-3.7
nox > Session tests-3.7 skipped: Python interpreter 3.7 not found.
nox > Running session tests-3.8
nox > Session tests-3.8 skipped: Python interpreter 3.8 not found.
nox > Running session tests-3.9
nox > Re-using existing virtual environment at .nox/tests-3-9.
nox > python -m pip install --progress-bar=off wheel
nox > python -m pip install --progress-bar=off coverage==5.2
nox > python -m pip install --progress-bar=off 'salt>=3003rc1'
nox > python -m pip install -e '.[tests]'
nox > coverage erase
nox > coverage run -m pytest --rootdir /Users/jamie/git/salt-sonic-test --log-file=artifacts/runtests-20220326190926.663140.log --log-file-level=debug --show-capture=no --junitxml=artifacts/junit-report.xml --showlocals -ra -s tests/
==================================================================== test session starts ====================================================================
platform darwin -- Python 3.9.11, pytest-6.2.4, py-1.11.0, pluggy-0.13.1
tempdir: /private/tmp/saltfactories
rootdir: /Users/jamie/git/salt-sonic-test
plugins: helpers-namespace-2021.12.29, salt-factories-0.911.0, tempdir-2019.10.12
collected 3 items

tests/integration/modules/test_my_extension.py E
tests/unit/modules/test_my_extension.py .
tests/unit/states/test_my_extension.py .

========================================================================== ERRORS ===========================================================================
____________________________________________ ERROR at setup of test_replace_this_this_with_something_meaningful _____________________________________________

salt_factories = FactoriesManager(root_dir=PosixPath('/private/tmp/saltfactories'), tmp_root_dir=PosixPath('/private/tmp/saltfactories'..._extension', inject_coverage=True, inject_sitecustomize=True, cwd=None, environ=None, slow_stop=True, start_timeout=60)

    @pytest.fixture(scope="package")
    def master(salt_factories):
>       return salt_factories.get_salt_master_daemon(random_string("master-"))
E       AttributeError: 'FactoriesManager' object has no attribute 'get_salt_master_daemon'

salt_factories = FactoriesManager(root_dir=PosixPath('/private/tmp/saltfactories'), tmp_root_dir=PosixPath('/private/tmp/saltfactories'..._extension', inject_coverage=True, inject_sitecustomize=True, cwd=None, environ=None, slow_stop=True, start_timeout=60)

tests/conftest.py:23: AttributeError
-------------------------------------- generated xml file: /Users/jamie/git/salt-sonic-test/artifacts/junit-report.xml --------------------------------------
================================================================== short test summary info ==================================================================
ERROR tests/integration/modules/test_my_extension.py::test_replace_this_this_with_something_meaningful - AttributeError: 'FactoriesManager' object has no ...
=========================================================== 2 passed, 1 error in 85.22s (0:01:25) ===========================================================
nox > Command coverage run -m pytest --rootdir /Users/jamie/git/salt-sonic-test --log-file=artifacts/runtests-20220326190926.663140.log --log-file-level=debug --show-capture=no --junitxml=artifacts/junit-report.xml --showlocals -ra -s tests/ failed with exit code 1
nox > coverage combine
nox > coverage xml -o artifacts/coverage-project.xml '--omit=tests/*' '--include=src/saltext/my_extension/*'
nox > coverage xml -o artifacts/coverage-tests.xml '--omit=src/saltext/my_extension/*' '--include=tests/*'
nox > coverage report --show-missing '--include=src/saltext/my_extension/*'
Name                                                   Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------
src/saltext/my_extension/__init__.py                       4      0      0      0   100%
src/saltext/my_extension/modules/__init__.py               0      0      0      0   100%
src/saltext/my_extension/modules/my_extension_mod.py       7      0      0      0   100%
src/saltext/my_extension/states/__init__.py                0      0      0      0   100%
src/saltext/my_extension/states/my_extension_mod.py       15      3      4      1    68%   17-19, 28->31
src/saltext/my_extension/version.py                        1      0      0      0   100%
--------------------------------------------------------------------------------------------------
TOTAL                                                     27      3      4      1    81%
nox > Session tests-3.9 failed.

ITJamie avatar Mar 26 '22 19:03 ITJamie

The proper pytest-salt-facrories version to use these days is the 1.0.0rc<latest>

s0undt3ch avatar Nov 18 '22 12:11 s0undt3ch

Salt Project / VMware has ended active development of this project, this repository will no longer be updated.

The community has created and maintained a better alternative to the development of Salt extensions: salt-extensions/salt-extension-copier (Create and maintain Salt extensions using Copier)

ScriptAutomate avatar Aug 02 '24 17:08 ScriptAutomate