Skip to content

Commit

Permalink
add new workflow syft.test.integration to test local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rasswanth-s committed May 15, 2024
1 parent d39b3e5 commit 65029ea
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pr-tests-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,71 @@ jobs:
run: |
tox -e backend.test.basecpu
pr-tests-syft-integration:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
pytest-modules: ["local_node"]
fail-fast: false

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Check for file changes
uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref }}
token: ${{ github.token }}
filters: .github/file-filters.yml

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: steps.changes.outputs.stack == 'true'
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
if: steps.changes.outputs.stack == 'true'
run: |
pip install --upgrade pip uv==0.1.35
uv --version
- name: Get pip cache dir
if: steps.changes.outputs.stack == 'true'
id: pip-cache
shell: bash
run: |
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v4
if: steps.changes.outputs.stack == 'true'
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-uv-py${{ matrix.python-version }}
- name: Install tox
if: steps.changes.outputs.stack == 'true'
run: |
pip install --upgrade tox tox-uv==1.5.1
- name: Run Syft Integration Tests
if: steps.changes.outputs.stack == 'true'
timeout-minutes: 60
env:
PYTEST_MODULES: "${{ matrix.pytest-modules }}"
GITHUB_CI: true
shell: bash
run: |
tox -e syft.test.integration
pr-tests-integration-k8s:
strategy:
max-parallel: 99
Expand Down
30 changes: 30 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,36 @@ commands =
python_version = 3.12
disable_error_code = attr-defined, valid-type, no-untyped-call, arg-type

[testenv:syft.test.integration]
description = Integration Tests for Syft Stack
basepython = python3
deps =
{[testenv:syft]deps}
{[testenv:hagrid]deps}
changedir = {toxinidir}
passenv=HOME, USER
allowlist_externals =
bash
setenv =
PYTEST_MODULES = {env:PYTEST_MODULES:local_node}
ASSOCIATION_REQUEST_AUTO_APPROVAL = {env:ASSOCIATION_REQUEST_AUTO_APPROVAL:true}
PYTEST_FLAGS = {env:PYTEST_FLAGS:--ignore=tests/integration/local/gateway_local_test.py}
commands =
python -c 'import syft as sy; sy.stage_protocol_changes()'

# Run Integration Tests
bash -c '\
PYTEST_MODULES=($PYTEST_MODULES); \
for i in "${PYTEST_MODULES[@]}"; do \
echo "Starting test for $i"; date; \
pytest tests/integration -m $i -vvvv -p no:randomly -p no:benchmark -o log_cli=True --capture=no $PYTEST_FLAGS; \
return=$?; \
echo "Finished $i"; \
date; \
if [[ $return -ne 0 ]]; then \
exit $return; \
fi; \
done'

[testenv:stack.test.integration.k8s]
description = Integration Tests for Core Stack using K8s
Expand Down

0 comments on commit 65029ea

Please sign in to comment.