Skip to content

Commit

Permalink
skipping long tests (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb authored Nov 15, 2024
1 parent eee24e4 commit 78dd2ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
23 changes: 3 additions & 20 deletions tests/create/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import hashlib
import json
import os
import sys
from functools import wraps
from unittest.mock import patch

Expand All @@ -38,24 +37,6 @@
assert NAMES, "No yaml files found in " + HERE


def is_ubuntu():
if os.path.isfile("/etc/os-release"):
with open("/etc/os-release") as f:
return "Ubuntu" in f.read()
return False


def is_darwin():
if os.path.isfile("/etc/os-release"):
with open("/etc/os-release") as f:
return "Darwin" in f.read()
return False


# run extensive tests only on Ubuntu and Darwin, and not on Python 3.9 and 3.11
extensive_tests = (sys.version_info[:2] not in [(3, 9), (3, 11)]) and (is_ubuntu() or is_darwin())


def mockup_from_source(func):
@wraps(func)
def wrapper(*args, **kwargs):
Expand Down Expand Up @@ -251,8 +232,10 @@ def compare(self):
# do not compare tendencies statistics yet, as we don't know yet if they should stay


# it would be nice to use a @pytest.mark.slow and configure this globally
# this could be done when refactoring the tests, and setting up canary/nightly builds
@pytest.mark.skipif(not os.environ.get("SLOW_TESTS"), reason="No SLOW_TESTS env var")
@pytest.mark.parametrize("name", NAMES)
@pytest.mark.skipif(not extensive_tests, reason="Skipping to run the test faster")
@mockup_from_source
def test_run(name):
config = os.path.join(HERE, name + ".yaml")
Expand Down
2 changes: 1 addition & 1 deletion tests/xarray/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
URL = "https://object-store.os-api.cci1.ecmwf.int/ml-tests/test-data/samples/"

SAMPLES = list(range(23))
SKIP = [0, 1, 2, 3, 4]
SKIP = [0, 1, 2, 3, 4, 22]


def _test_samples(n, check_skip=True):
Expand Down

0 comments on commit 78dd2ae

Please sign in to comment.