Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion dags/common/quarantined_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import dataclasses
import fnmatch
import logging
import os
from typing import Set

from airflow.models import Variable
Expand Down Expand Up @@ -52,6 +54,20 @@ def match_quarantine_patterns(
return False


def safe_get_from_variable(key: str, default_var: str):
"""
Check if the current runtime is GitHub Actions. Ignoring getting variable in GitHub Actions to prevent from
spamming logs.
"""
value = default_var
is_CI = os.getenv("GITHUB_ACTIONS", "false").lower() == "true"
if is_CI:
logging.info("In GitHub Actions, skip getting variables")
else:
value = Variable.get(key, default_var=default_var)
return value


"""
The quarantine list is defined by a set of UNIX Shell Glob Patterns.
These patterns are used to match and quarantine tests.
Expand All @@ -63,7 +79,7 @@ def match_quarantine_patterns(
- maxd-sdxl-* (Matches all 'maxd-sdxl-' tests)
"""
quarantine_patterns = parse_quarantine_patterns(
Variable.get("quarantine_patterns", "")
safe_get_from_variable("quarantine_patterns", "")
)


Expand Down
Loading