Only show the warnings when running the download package tests

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-04-15 17:28:31 +01:00 committed by Pedro Algarvio
parent f56dfae0c0
commit d33a8b7b4a
2 changed files with 9 additions and 5 deletions

View file

@ -1790,6 +1790,7 @@ def test_pkgs_onedir(session):
env = {
"ONEDIR_TESTRUN": "1",
"PKG_TEST_TYPE": chunk,
}
if chunk == "upgrade-classic":

View file

@ -257,11 +257,14 @@ def root_url(salt_release):
def get_salt_release():
salt_release = os.environ.get("SALT_RELEASE")
pkg_test_type = os.environ.get("PKG_TEST_TYPE", "install")
if salt_release is None:
if pkg_test_type == "download-pkgs":
log.warning(
"Setting salt release to 3006.0rc2 which is probably not what you want."
)
salt_release = "3006.0rc2"
if pkg_test_type == "download-pkgs":
if packaging.version.parse(salt_release) < packaging.version.parse("3006.0rc1"):
log.warning(f"The salt release being tested, {salt_release!r} looks off.")
return salt_release