Skip to content

Unittest PR for workflow update #45

Unittest PR for workflow update

Unittest PR for workflow update #45

Workflow file for this run

name: Python Unit Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
- name: Run All Tests
run: |
python -m unittest discover -s tests -p '*_test.py'
- name: Run MNIST example.
run: |
pip install torchvision
cd examples/mnist
python train.py --env UNIT > train_output.txt 2>&1
TRAIN_STATUS=$?
python compute_influences.py --env UNIT > compute_output.txt 2>&1
COMPUTE_STATUS=$?
if [ $TRAIN_STATUS -ne 0 ]; then
echo "Train.py failed with the following output:"
cat train_output.txt
exit $TRAIN_STATUS
fi
if [ $COMPUTE_STATUS -ne 0 ]; then
echo "Compute_influences.py failed with the following output:"
cat compute_output.txt
exit $COMPUTE_STATUS
fi