Skip to content

Commit

Permalink
Merge branch 'ConnorHack:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Meta-Llama-Bot authored Oct 3, 2024
2 parents 9853ef4 + 90766d2 commit b8c617f
Showing 1 changed file with 53 additions and 42 deletions.
95 changes: 53 additions & 42 deletions .github/workflows/gha_workflow_llama_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: opened
branches:
- 'main'
#paths:
#- 'models/**/*.py'
paths:
- 'models/**/*.py'

workflow_dispatch:
inputs:
Expand All @@ -25,10 +25,10 @@ on:
required: true
default: "0"

api_tests:
description: 'Include tests with API keys'
required: true
default: false
api_key:
description: 'Provider API key'
required: false
default: "---"

model:
description: 'Llama model to use for testing'
Expand All @@ -43,6 +43,7 @@ on:
env:
TOKENIZER_PATH: "models/llama3/api/tokenizer.model"
MODELS_PATH: '/data/llama3/models'
API_KEY: ${{ github.event.inputs.api_key }}

jobs:
execute_workflow:
Expand Down Expand Up @@ -121,7 +122,6 @@ jobs:
sudo apt update -y
sudo apt upgrade -y
sudo apt install python3-pip -y
sudo apt install git-lfs -y
- name: "Installing 'llama-models' dependencies"
id: pip_install
Expand All @@ -134,56 +134,67 @@ jobs:
pip install xmlrunner
pip install pytest
######################
#### TEST RUNNING ####
######################

#- name: Run Tokenizer tests
# id: run_tests_tokenizer
# if: always()
# run: |
# echo "[STEP]Running Tokenizer tests on Self-Hosted k8s ARC Runner"
# cd $GITHUB_WORKSPACE && python3 -m unittest models/llama3/api/test_tokenizer.py

#- name: Run tool utils tests
# id: run_tests_tool_utils
# if: always()
# run: |
# echo "[STEP] Running tool utils test on Self-Hosted k8s ARC Runner"
# cd $GITHUB_WORKSPACE && python3 -m unittest models/llama3/tests/api/test_tool_utils.py --junitxml="$GITHUB_WORKSPACE/result.xml"

- name: "Running PyTest tests on Self-Hosted k8s ARC Runner"
id: pytest
############################################
#### AUTOMATIC TESTING ON PULL REQUESTS ####
############################################

#### Run tests ####

- name: Run Tokenizer tests
id: run_tests_tokenizer
working-directory: ${{ github.workspace }}
if: github.event_name == 'pull_request_target'
run: |
echo "Running PyTest tests at 'GITHUB_WORKSPACE' path: ${GITHUB_WORKSPACE} | path: ${{ github.workspace }}"
python3 -m pytest --junitxml="${{ github.workspace }}/result.xml"
echo "[STEP]Running Tokenizer tests on Self-Hosted k8s ARC Runner"
python3 -m pytest models/llama3/ --junitxml="${{ github.workspace }}/result.xml"
#### Create test summary ####

####################################
#### TEST REPORTS AND SUMMARIES ####
####################################
- name: Test Summary
id: create_test_summary
- name: PR - Test Summary
id: create_test_summary_pr
if: github.event_name == 'pull_request_target'
uses: test-summary/action@v2
with:
paths: "${{ github.workspace }}/result.xml"
output: test-summary.md
if: always()

- name: Upload test summary
id: publish_test_summary
uses: actions/upload-artifact@v4
- name: PR - Upload Test Summary
id: publish_test_summary_pr
if: github.event_name == 'pull_request_target'
uses: actions/upload-artifact@v3
with:
name: test-summary
path: test-summary.md
if: always()

##############################
#### PULL REQUEST COMMENT ####
##############################
#### Update PR request ####

- name: Update Pull Request with a comment
id: publish_pr_comment
if: github.event_name == 'pull_request_target'
uses: thollander/actions-comment-pull-request@v2
with:
filePath: test-summary.md


########################
#### MANUAL TESTING ####
########################

#### Run tests ####

- name: "Running all PyTest tests on Self-Hosted k8s ARC Runner"
id: pytest
working-directory: ${{ github.workspace }}
if: github.event_name == 'workflow_dispatch'
run: |
echo "[STEP] Running PyTest tests at 'GITHUB_WORKSPACE' path: ${GITHUB_WORKSPACE} | path: ${{ github.workspace }}"
python3 -m pytest --junitxml="${{ github.workspace }}/result.xml"
#### Create test summary ####

- name: Manual - Test Summary
id: create_test_summary_manual
if: github.event_name == 'workflow_dispatch'
uses: test-summary/action@v2
with:
paths: "${{ github.workspace }}/result.xml"

0 comments on commit b8c617f

Please sign in to comment.