Skip to content

Commit

Permalink
fixed race condition in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Mar 1, 2024
1 parent aa4696e commit 5e751e9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/test_utils/test_filesystem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import platform
import shutil
import sys
import tempfile
from pathlib import Path
from typing import List, Optional
Expand Down Expand Up @@ -27,9 +29,29 @@
)


# NOTE: needed for tests running in GitHub Actions using the matrix strategy
# to avoid race conditions when running tests in parallel
def get_python_version():
version = sys.version_info
formatted_version = f"{version.major}{version.minor}"
return formatted_version


def get_os():
os_name = platform.system().lower()
if "darwin" in os_name:
return "mac"
elif "linux" in os_name:
return "lin"
elif "windows" in os_name:
return "win"
else:
raise ValueError(f"Unsupported operating system: {os_name}")


@pytest.fixture
def fs(request):
url_path = f"{request.param}://{URL_PATH}"
url_path = f"{request.param}://{URL_PATH}_{get_os()}_{get_python_version()}"
yield LuxonisFileSystem(url_path)


Expand Down

0 comments on commit 5e751e9

Please sign in to comment.