mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix centos upgrade tests
This commit is contained in:
parent
5e26146fe4
commit
2e85cc95ad
3 changed files with 17 additions and 5 deletions
10
noxfile.py
10
noxfile.py
|
@ -11,8 +11,10 @@ import gzip
|
|||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shutil
|
||||
import sqlite3
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
|
@ -1807,10 +1809,16 @@ def test_upgrade_pkgs(session, classic):
|
|||
]
|
||||
if classic:
|
||||
cmd_args = cmd_args + ["--classic"]
|
||||
if "amzn2" in platform.release():
|
||||
# Workaround for installing and running classic packages from 3005.1
|
||||
# on amazon linux 2. They can only run with importlib-metadata<5.0.0.
|
||||
subprocess.run(
|
||||
["pip3", "install", "importlib-metadata==4.13.0"], check=False
|
||||
)
|
||||
try:
|
||||
_pkg_test(session, cmd_args, test_type)
|
||||
except nox.command.CommandFailed:
|
||||
sys.exit(1)
|
||||
|
||||
cmd_args = ["pkg/tests/"] + session.posargs
|
||||
cmd_args = ["pkg/tests/", "--no-install"] + session.posargs
|
||||
_pkg_test(session, cmd_args, test_type)
|
||||
|
|
|
@ -110,7 +110,7 @@ class SaltPkgInstall:
|
|||
|
||||
@distro_name.default
|
||||
def _default_distro_name(self):
|
||||
return distro.name().lower()
|
||||
return distro.name().split()[0].lower()
|
||||
|
||||
@distro_version.default
|
||||
def _default_distro_version(self):
|
||||
|
|
10
tools/ci.py
10
tools/ci.py
|
@ -638,11 +638,15 @@ def pkg_matrix(ctx: Context, distro_slug: str):
|
|||
Generate the test matrix.
|
||||
"""
|
||||
_matrix = []
|
||||
for sess in (
|
||||
sessions = [
|
||||
"test-pkgs-3",
|
||||
"'test-upgrade-pkgs-3(classic=False)'",
|
||||
"'test-upgrade-pkgs-3(classic=True)'",
|
||||
):
|
||||
]
|
||||
if distro_slug not in ["centosstream-9", "ubuntu-22.04"]:
|
||||
# Packages for these OSs where never built for classic previously
|
||||
sessions.append("'test-upgrade-pkgs-3(classic=True)'")
|
||||
|
||||
for sess in sessions:
|
||||
_matrix.append({"nox-session": sess})
|
||||
print(json.dumps(_matrix))
|
||||
ctx.exit(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue