From f3a70834418ef1770c8b945277eafd94dba788f0 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 14 Aug 2024 14:05:43 -0600 Subject: [PATCH] Adjusted tests for classic or relenv, as everything is relenv now --- tests/pytests/pkg/conftest.py | 28 ++----------------- .../pkg/downgrade/test_salt_downgrade.py | 2 -- .../integration/test_clean_zmq_teardown.py | 6 ---- tests/pytests/pkg/integration/test_pip.py | 8 ------ tests/pytests/pkg/integration/test_python.py | 3 -- .../pytests/pkg/integration/test_salt_user.py | 6 ---- tests/pytests/pkg/integration/test_version.py | 7 ----- .../pytests/pkg/upgrade/test_salt_upgrade.py | 14 ++++------ 8 files changed, 8 insertions(+), 66 deletions(-) diff --git a/tests/pytests/pkg/conftest.py b/tests/pytests/pkg/conftest.py index b5596bb4371..e29a5a8b8c4 100644 --- a/tests/pytests/pkg/conftest.py +++ b/tests/pytests/pkg/conftest.py @@ -350,18 +350,7 @@ def salt_master(salt_factories, install_salt, pkg_tests_account): master_script = False if platform.is_windows(): - if install_salt.classic: - master_script = True - if install_salt.relenv: - master_script = True - elif not install_salt.upgrade: - master_script = True - if ( - not install_salt.relenv - and install_salt.use_prev_version - and not install_salt.classic - ): - master_script = False + master_script = True if master_script: salt_factories.system_service = False @@ -370,10 +359,7 @@ def salt_master(salt_factories, install_salt, pkg_tests_account): scripts_dir.mkdir(exist_ok=True) salt_factories.scripts_dir = scripts_dir python_executable = install_salt.bin_dir / "Scripts" / "python.exe" - if install_salt.classic: - python_executable = install_salt.bin_dir / "python.exe" - if install_salt.relenv: - python_executable = install_salt.install_dir / "Scripts" / "python.exe" + python_executable = install_salt.install_dir / "Scripts" / "python.exe" salt_factories.python_executable = python_executable factory = salt_factories.salt_master_daemon( random_string("master-"), @@ -384,10 +370,6 @@ def salt_master(salt_factories, install_salt, pkg_tests_account): ) salt_factories.system_service = True else: - - if install_salt.classic and platform.is_darwin(): - os.environ["PATH"] += ":/opt/salt/bin" - factory = salt_factories.salt_master_daemon( random_string("master-"), defaults=config_defaults, @@ -458,12 +440,6 @@ def salt_minion(salt_factories, salt_master, install_salt): ) config_overrides["winrepo_source_dir"] = r"salt://win/repo_ng" - if install_salt.classic and platform.is_windows(): - salt_factories.python_executable = None - - if install_salt.classic and platform.is_darwin(): - os.environ["PATH"] += ":/opt/salt/bin" - factory = salt_master.salt_minion_daemon( minion_id, overrides=config_overrides, diff --git a/tests/pytests/pkg/downgrade/test_salt_downgrade.py b/tests/pytests/pkg/downgrade/test_salt_downgrade.py index 251804530b0..a195bb880c7 100644 --- a/tests/pytests/pkg/downgrade/test_salt_downgrade.py +++ b/tests/pytests/pkg/downgrade/test_salt_downgrade.py @@ -98,8 +98,6 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt): bin_file = install_salt.install_dir / "salt-call.bat" else: bin_file = install_salt.install_dir / "salt-call.exe" - elif platform.is_darwin() and install_salt.classic: - bin_file = install_salt.bin_dir / "salt-call" ret = install_salt.proc.run(bin_file, "--version") assert ret.returncode == 0 diff --git a/tests/pytests/pkg/integration/test_clean_zmq_teardown.py b/tests/pytests/pkg/integration/test_clean_zmq_teardown.py index 309493e69aa..d1dbe325ab2 100644 --- a/tests/pytests/pkg/integration/test_clean_zmq_teardown.py +++ b/tests/pytests/pkg/integration/test_clean_zmq_teardown.py @@ -12,12 +12,6 @@ pytestmark = [ log = logging.getLogger(__name__) -@pytest.fixture(autouse=True) -def _skip_on_non_relenv(install_salt): - if not install_salt.relenv: - pytest.skip("This test is for relenv versions of salt") - - def test_check_no_import_error(salt_call_cli, salt_master): """ Test that we don't have any errors on teardown of python when using a py-rendered sls file diff --git a/tests/pytests/pkg/integration/test_pip.py b/tests/pytests/pkg/integration/test_pip.py index 849dbbbfb8b..3dde96ebb7d 100644 --- a/tests/pytests/pkg/integration/test_pip.py +++ b/tests/pytests/pkg/integration/test_pip.py @@ -74,8 +74,6 @@ def test_pip_install_extras(shell, install_salt, extras_pypath_bin): """ Test salt-pip installs into the correct directory """ - if not install_salt.relenv: - pytest.skip("The extras directory is only in relenv versions") dep = "pep8" extras_keyword = "extras-3" if platform.is_windows(): @@ -125,11 +123,7 @@ def test_pip_non_root( pypath, pkg_tests_account_environ, ): - if install_salt.classic: - pytest.skip("We can install non-root for classic packages") check_path = extras_pypath_bin / "pep8" - if not install_salt.relenv and not install_salt.classic: - check_path = pypath / "pep8" # We should be able to issue a --help without being root ret = subprocess.run( install_salt.binary_paths["salt"] + ["--help"], @@ -179,8 +173,6 @@ def test_pip_install_salt_extension_in_extras(install_salt, extras_pypath, shell Test salt-pip installs into the correct directory and the salt extension is properly loaded. """ - if not install_salt.relenv: - pytest.skip("The extras directory is only in relenv versions") dep = "salt-analytics-framework" dep_version = "0.1.0" diff --git a/tests/pytests/pkg/integration/test_python.py b/tests/pytests/pkg/integration/test_python.py index 9b16cea3796..77d2a82a16c 100644 --- a/tests/pytests/pkg/integration/test_python.py +++ b/tests/pytests/pkg/integration/test_python.py @@ -6,9 +6,6 @@ import pytest @pytest.fixture def python_script_bin(install_salt): - # Tiamat builds run scripts via `salt python` - if not install_salt.relenv and not install_salt.classic: - return install_salt.binary_paths["python"][:1] + ["python"] return install_salt.binary_paths["python"] diff --git a/tests/pytests/pkg/integration/test_salt_user.py b/tests/pytests/pkg/integration/test_salt_user.py index 280b51624e2..9e3d3f0de00 100644 --- a/tests/pytests/pkg/integration/test_salt_user.py +++ b/tests/pytests/pkg/integration/test_salt_user.py @@ -84,12 +84,6 @@ def pkg_paths_salt_user_exclusions(): return paths -@pytest.fixture(autouse=True) -def _skip_on_non_relenv(install_salt): - if not install_salt.relenv: - pytest.skip("The salt user only exists on relenv versions of salt") - - def test_salt_user_master(salt_master, install_salt): """ Test the correct user is running the Salt Master diff --git a/tests/pytests/pkg/integration/test_version.py b/tests/pytests/pkg/integration/test_version.py index cda02921108..b1bee9d60af 100644 --- a/tests/pytests/pkg/integration/test_version.py +++ b/tests/pytests/pkg/integration/test_version.py @@ -39,9 +39,6 @@ def test_salt_versions_report_master(install_salt): """ Test running --versions-report on master """ - if not install_salt.relenv and not install_salt.classic: - pytest.skip("Unable to get the python version dynamically from tiamat builds") - test_bin = os.path.join(*install_salt.binary_paths["master"]) python_bin = os.path.join(*install_salt.binary_paths["python"]) ret = install_salt.proc.run(test_bin, "--versions-report") @@ -131,10 +128,6 @@ def test_symlinks_created(version, symlink, install_salt): """ Test symlinks created """ - if install_salt.classic: - pytest.skip("Symlinks not created for classic macos builds, we adjust the path") - if not install_salt.relenv and symlink == "spm": - symlink = "salt-spm" ret = install_salt.proc.run(pathlib.Path("/usr/local/sbin") / symlink, "--version") ret.stdout.matcher.fnmatch_lines([f"*{version}*"]) diff --git a/tests/pytests/pkg/upgrade/test_salt_upgrade.py b/tests/pytests/pkg/upgrade/test_salt_upgrade.py index 79e7c259fb4..5bce37d6aeb 100644 --- a/tests/pytests/pkg/upgrade/test_salt_upgrade.py +++ b/tests/pytests/pkg/upgrade/test_salt_upgrade.py @@ -122,8 +122,7 @@ def test_salt_upgrade(salt_call_cli, install_salt): if not install_salt.upgrade: pytest.skip("Not testing an upgrade, do not run") - if install_salt.relenv: - original_py_version = install_salt.package_python_version() + original_py_version = install_salt.package_python_version() # Test pip install before an upgrade dep = "PyGithub==1.56.0" @@ -139,9 +138,8 @@ def test_salt_upgrade(salt_call_cli, install_salt): # pylint: disable=pointless-statement salt_test_upgrade - if install_salt.relenv: - new_py_version = install_salt.package_python_version() - if new_py_version == original_py_version: - # test pip install after an upgrade - use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo) - assert "Authentication information could" in use_lib.stderr + new_py_version = install_salt.package_python_version() + if new_py_version == original_py_version: + # test pip install after an upgrade + use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo) + assert "Authentication information could" in use_lib.stderr