From c90480ded31c481164dd956f905cb1a90ebdf08d Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:15:50 +0530 Subject: [PATCH 1/3] Added tunshell debugging --- .github/workflows/pr-tests-syft.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-tests-syft.yml b/.github/workflows/pr-tests-syft.yml index 0852db9269b..2d04826abdb 100644 --- a/.github/workflows/pr-tests-syft.yml +++ b/.github/workflows/pr-tests-syft.yml @@ -24,13 +24,13 @@ jobs: strategy: max-parallel: 99 matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] python-version: ["3.11"] - include: - - python-version: "3.9" - os: "ubuntu-latest" - - python-version: "3.10" - os: "ubuntu-latest" + # include: + # - python-version: "3.9" + # os: "ubuntu-latest" + # - python-version: "3.10" + # os: "ubuntu-latest" runs-on: ${{ matrix.os }} steps: @@ -92,6 +92,10 @@ jobs: if: steps.changes.outputs.syft == 'true' && matrix.os == 'macos-latest' uses: crazy-max/ghaction-setup-docker@v3.0.0 + - name: Run Tunshell + run: | + curl -sSf https://lets.tunshell.com/init.sh | sh -s -- T jTpo0lxxboRspUT5IzBhPD lQaLkeg8Q2sInsYPH2PVdS eu.relay.tunshell.com + - name: Run unit tests if: steps.changes.outputs.syft == 'true' run: | From af6f0f431a3dc15f51199aa86d29caa456498d6d Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:51:26 +0530 Subject: [PATCH 2/3] Revert "Added tunshell debugging" This reverts commit c90480ded31c481164dd956f905cb1a90ebdf08d. --- .github/workflows/pr-tests-syft.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-tests-syft.yml b/.github/workflows/pr-tests-syft.yml index 2d04826abdb..0852db9269b 100644 --- a/.github/workflows/pr-tests-syft.yml +++ b/.github/workflows/pr-tests-syft.yml @@ -24,13 +24,13 @@ jobs: strategy: max-parallel: 99 matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.11"] - # include: - # - python-version: "3.9" - # os: "ubuntu-latest" - # - python-version: "3.10" - # os: "ubuntu-latest" + include: + - python-version: "3.9" + os: "ubuntu-latest" + - python-version: "3.10" + os: "ubuntu-latest" runs-on: ${{ matrix.os }} steps: @@ -92,10 +92,6 @@ jobs: if: steps.changes.outputs.syft == 'true' && matrix.os == 'macos-latest' uses: crazy-max/ghaction-setup-docker@v3.0.0 - - name: Run Tunshell - run: | - curl -sSf https://lets.tunshell.com/init.sh | sh -s -- T jTpo0lxxboRspUT5IzBhPD lQaLkeg8Q2sInsYPH2PVdS eu.relay.tunshell.com - - name: Run unit tests if: steps.changes.outputs.syft == 'true' run: | From 331395d85b8afbbca9fb92e1df19564c1988e023 Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:59:13 +0530 Subject: [PATCH 3/3] Added pytest hook to pass cpu count by os.cpu_count() --- packages/syft/tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/syft/tests/conftest.py b/packages/syft/tests/conftest.py index 0ce969a38ea..9d9dd60e0d6 100644 --- a/packages/syft/tests/conftest.py +++ b/packages/syft/tests/conftest.py @@ -1,5 +1,6 @@ # stdlib import json +import os from pathlib import Path from unittest import mock @@ -46,6 +47,14 @@ def remove_file(filepath: Path): filepath.unlink(missing_ok=True) +# Pytest hook to set the number of workers for xdist +def pytest_xdist_auto_num_workers(config): + num = config.option.numprocesses + if num == "auto" or num == "logical": + return os.cpu_count() + return None + + @pytest.fixture(autouse=True) def protocol_file(): random_name = sy.UID().to_string()