Adjusted tests for classic or relenv, as everything is relenv now

This commit is contained in:
David Murphy 2024-08-14 14:05:43 -06:00 committed by Daniel Wozniak
parent 3d7ebf028d
commit f3a7083441
8 changed files with 8 additions and 66 deletions

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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"]

View file

@ -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

View file

@ -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}*"])

View file

@ -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