From ac20d2fd7568a2f8fb1e68ba4df04f4be3fc0431 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 10 May 2024 14:53:11 -0600 Subject: [PATCH] Attempting to allow for upgrade and downgrade tests --- tools/ci.py | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/tools/ci.py b/tools/ci.py index c5cf22cc851..7d43cf54afc 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -770,13 +770,19 @@ def pkg_matrix( gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None if gh_event_path is None: ctx.warn("The 'GITHUB_EVENT_PATH' variable is not set.") - else: - try: - gh_event = json.loads(open(gh_event_path, encoding="utf-8").read()) - except Exception as exc: - ctx.error( - f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc - ) + ctx.exit(1) + + if TYPE_CHECKING: + assert gh_event_path is not None + + try: + gh_event = json.loads(open(gh_event_path, encoding="utf-8").read()) + except Exception as exc: + ctx.error(f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc) + ctx.exit(1) + + if TYPE_CHECKING: + assert gh_event is not None github_output = os.environ.get("GITHUB_OUTPUT") if github_output is None: @@ -859,16 +865,6 @@ def pkg_matrix( ] for version, backend in adjusted_versions: - if ( - distro_slug.startswith(("macos-", "debian-", "ubuntu-")) - or version.major < 3006 - ): - # XXX: Temporarily skip problematic tests - ctx.warn( - f"Temporary skip builds on {distro_slug} for version {version} with backend {backend}" - ) - continue - prefix = prefixes[backend] # TODO: Remove this after 3009.0 if backend == "relenv" and version >= tools.utils.Version("3006.5"): @@ -885,10 +881,9 @@ def pkg_matrix( # key_filter = f"Contents[?contains(Key, '{version}')] | [?ends_with(Key, '.msi')]" continue elif pkg_type == "NSIS": - # XXX: Temporarily skip problematic tests - # key_filter = ( - # f"Contents[?contains(Key, '{version}')] | [?ends_with(Key, '.exe')]" - # ) + key_filter = ( + f"Contents[?contains(Key, '{version}')] | [?ends_with(Key, '.exe')]" + ) continue objects = list(page_iterator.search(key_filter)) # Testing using `any` because sometimes the paginator returns `[None]` @@ -916,8 +911,7 @@ def pkg_matrix( ctx.print(" * ", entry, soft_wrap=True) if ( - gh_event is not None - and gh_event["repository"]["fork"] is True + gh_event["repository"]["fork"] is True and "macos" in distro_slug and "arm64" in distro_slug ):