forked from goodboy/tractor
Simplified CI detection
parent
03e5852acf
commit
c993e36e95
|
@ -8,9 +8,6 @@ import random
|
|||
import signal
|
||||
import platform
|
||||
import time
|
||||
import enum
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import pytest
|
||||
import tractor
|
||||
|
@ -77,21 +74,11 @@ def spawn_backend(request):
|
|||
return request.config.option.spawn_backend
|
||||
|
||||
|
||||
class CIEnvoirment(enum.Enum):
|
||||
Travis = 'TRAVIS'
|
||||
Github = 'GITHUB'
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def ci_env() -> Optional[CIEnvoirment]:
|
||||
def ci_env() -> bool:
|
||||
"""Detect CI envoirment.
|
||||
"""
|
||||
if os.environ.get('TRAVIS'):
|
||||
return CIEnvoirment.Travis
|
||||
elif os.environ.get('CI'):
|
||||
return CIEnvoirment.Github
|
||||
else:
|
||||
return None
|
||||
return os.environ.get('TRAVIS', False) or os.environ.get('CI', False)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
|
|
|
@ -9,8 +9,6 @@ import trio
|
|||
import tractor
|
||||
import pytest
|
||||
|
||||
from conftest import CIEnvoirment
|
||||
|
||||
|
||||
def test_must_define_ctx():
|
||||
|
||||
|
@ -205,12 +203,11 @@ async def cancel_after(wait):
|
|||
|
||||
@pytest.fixture(scope='module')
|
||||
def time_quad_ex(arb_addr, ci_env, spawn_backend):
|
||||
if ci_env in (CIEnvoirment.Github, CIEnvoirment.Travis):
|
||||
if spawn_backend == 'mp' and (platform.system() != 'Windows'):
|
||||
"""no idea, but the travis and github actions, mp *nix runs are
|
||||
flaking out here often
|
||||
"""
|
||||
pytest.skip("Test is too flaky on mp in CI")
|
||||
if ci_env and spawn_backend == 'mp' and (platform.system() != 'Windows'):
|
||||
"""no idea, but the travis and github actions, mp *nix runs are
|
||||
flaking out here often
|
||||
"""
|
||||
pytest.skip("Test is too flaky on mp in CI")
|
||||
|
||||
timeout = 7 if platform.system() in ('Windows', 'Darwin') else 4
|
||||
start = time.time()
|
||||
|
|
Loading…
Reference in New Issue