Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into karansh1/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterSkepticista committed Dec 18, 2024
2 parents dddeda7 + 1a39d3c commit 50ae181
Show file tree
Hide file tree
Showing 36 changed files with 1,558 additions and 744 deletions.
36 changes: 36 additions & 0 deletions .github/actions/tr_post_test_run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# Composite Action to run post-test functions for task runner end to end tests

name: 'Post-Test Functions'
description: 'Run post-test functions'
inputs:
test_type:
description: 'Test type'
required: true

runs:
using: 'composite'
steps:
- name: Print test summary
id: print_test_summary
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
shell: bash

- name: Create Tar (exclude cert and data folders)
id: tar_files
if: ${{ always() }}
run: |
tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results
shell: bash

- name: Upload Artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: ${{ inputs.test_type }}_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
22 changes: 22 additions & 0 deletions .github/actions/tr_pre_test_run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Composite Action to run pre-test functions for task runner end to end tests

name: 'Pre-Test Functions'
description: 'Run pre-test functions'

runs:
using: 'composite'
steps:
- name: Set up Python
id: setup_python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
id: install_dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r test-requirements.txt
shell: bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
#---------------------------------------------------------------------------
# Workflow to run Task Runner end to end tests
# Authors - Noopur, Payal Chaurasiya
#---------------------------------------------------------------------------
name: Task Runner E2E
# Task Runner E2E tests for bare metal approach

name: Task_Runner_E2E # Please do not modify the name as it is used in the composite action

on:
schedule:
Expand Down Expand Up @@ -55,48 +53,23 @@ jobs:
submodules: "true"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
id: setup_python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
id: install_dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r test-requirements.txt
- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

- name: Run Task Runner E2E tests with TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }}
echo "Task runner end to end test run completed"
- name: Print test summary
id: print_test_summary
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Create Tar (exclude cert and data folders)
id: tar_files
if: ${{ always() }}
run: |
tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results
- name: Upload Artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
name: tr_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
test_type: "tr_tls"

test_with_non_tls:
name: tr_non_tls
Expand All @@ -123,48 +96,23 @@ jobs:
submodules: "true"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
id: setup_python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
id: install_dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r test-requirements.txt
- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

- name: Run Task Runner E2E tests without TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_tls
echo "Task runner end to end test run completed"
- name: Print test summary
id: print_test_summary
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Create Tar (exclude cert and data folders)
id: tar_files
if: ${{ always() }}
run: |
tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results
- name: Upload Artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
name: tr_non_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
test_type: "tr_non_tls"

test_with_no_client_auth:
name: tr_no_client_auth
Expand All @@ -191,48 +139,23 @@ jobs:
submodules: "true"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
id: setup_python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
id: install_dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r test-requirements.txt
- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

- name: Run Task Runner E2E tests without TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_client_auth
echo "Task runner end to end test run completed"
- name: Print test summary
id: print_test_summary
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Create Tar (exclude cert and data folders)
id: tar_files
if: ${{ always() }}
run: |
tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results
- name: Upload Artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
name: tr_no_client_auth_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
test_type: "tr_no_client_auth"

test_memory_logs:
name: tr_tls_memory_logs
Expand All @@ -259,44 +182,21 @@ jobs:
submodules: "true"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
id: setup_python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
id: install_dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r test-requirements.txt
- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

- name: Run Task Runner E2E tests with TLS and memory logs
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/memory_logs_tests.py \
--model_name ${{ env.MODEL_NAME }} --num_rounds ${{ env.NUM_ROUNDS }} \
--num_collaborators ${{ env.NUM_COLLABORATORS }} --log_memory_usage
-k test_log_memory_usage_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} \
--log_memory_usage
echo "Task runner memory logs test run completed"
- name: Print test summary
id: print_test_summary
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Tar files
id: tar_files
if: ${{ always() }}
run: tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results

- name: Upload Artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
name: tr_tls_memory_logs_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
test_type: "tr_tls_memory_logs"
Loading

0 comments on commit 50ae181

Please sign in to comment.