Fixed style

This commit is contained in:
Smita Kulkarni 2023-09-18 14:07:31 +02:00
parent 0a042fc3f0
commit 0c26f41ac9

View File

@ -321,58 +321,56 @@ class PRInfo:
for f in self.changed_files
)
def can_skip_integration_tests(self, versions: List[str]):
if FORCE_TESTS_LABEL in self.labels:
return False
def can_skip_integration_tests(self, versions: List[str]):
if FORCE_TESTS_LABEL in self.labels:
return False
# If docker image(s) relevant to integration tests are updated
if any(self.sha in version for version in versions):
return False
# If docker image(s) relevant to integration tests are updated
if any(self.sha in version for version in versions):
return False
if self.changed_files is None or not self.changed_files:
return False
if self.changed_files is None or not self.changed_files:
return False
if not self.can_skip_builds_and_use_version_from_master():
return False
if not self.can_skip_builds_and_use_version_from_master():
return False
# Integration tests can be skipped if integration tests are not changed
return not any(
f.startswith("tests/integration/") or f == "tests/ci/integration_test_check.py"
for f in self.changed_files
)
def can_skip_functional_tests(
self, version, test_type: Literal["stateless", "stateful"]
):
if FORCE_TESTS_LABEL in self.labels:
return False
# If docker image(s) relevant to functional tests are updated
if self.sha not in version:
return False
if self.changed_files is None or not self.changed_files:
return False
if not self.can_skip_builds_and_use_version_from_master():
return False
# Functional tests can be skipped if queries tests are not changed
if test_type == "stateless":
# Integration tests can be skipped if integration tests are not changed
return not any(
f.startswith("tests/queries/0_stateless")
or f == "tests/ci/functional_test_check.py"
for f in self.changed_files
)
else: # stateful
return not any(
f.startswith("tests/queries/1_stateful")
or f == "tests/ci/functional_test_check.py"
f.startswith("tests/integration/") or f == "tests/ci/integration_test_check.py"
for f in self.changed_files
)
def can_skip_functional_tests(
self, version, test_type: Literal["stateless", "stateful"]
):
if FORCE_TESTS_LABEL in self.labels:
return False
# If docker image(s) relevant to functional tests are updated
if self.sha not in version:
return False
if self.changed_files is None or not self.changed_files:
return False
if not self.can_skip_builds_and_use_version_from_master():
return False
# Functional tests can be skipped if queries tests are not changed
if test_type == "stateless":
return not any(
f.startswith("tests/queries/0_stateless")
or f == "tests/ci/functional_test_check.py"
for f in self.changed_files
)
else: # stateful
return not any(
f.startswith("tests/queries/1_stateful")
or f == "tests/ci/functional_test_check.py"
for f in self.changed_files
)
class FakePRInfo:
def __init__(self):