Skip to content

Commit

Permalink
feat(tests): cache file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Mehr committed May 25, 2024
1 parent b4f3391 commit 0098e4e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
63 changes: 28 additions & 35 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,43 +121,36 @@ jobs:
- name: Run setup.py build
run: python setup.py build

integration_test:
name: Run Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4

- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v3
with:
integration_test:
name: Run Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip
- name: Add directory to Python path
run: echo "PYTHONPATH=$(python -c 'import sys; print(':'.join(sys.path))'):$(pwd)" >> $GITHUB_ENV

- name: Install dependencies
run: pip install -r requirements.txt

- name: Install dev dependencies
run: pip install -r requirements-dev.txt

- name: Set up cache directory
run: |
mkdir -p ./cache
ls -la cache
echo "DSP_NOTEBOOK_CACHEDIR=$(pwd)/cache" >> $GITHUB_ENV
- name: Run tests with pytest
run: pytest -c tests_integration/pytest.ini tests_integration/
- name: Add directory to Python path
run: echo "PYTHONPATH=$(python -c 'import sys; print(":".join(sys.path))'):$(pwd)" >> $GITHUB_ENV
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install dev dependencies
run: pip install -r requirements-dev.txt
- name: Set up cache directory
run: |
pwd ./cache
ls -la cache
echo "DSP_NOTEBOOK_CACHEDIR=$(pwd)/cache" >> $GITHUB_ENV
- name: Run tests with pytest
run: pytest -c tests_integration/pytest.ini tests_integration/
1 change: 0 additions & 1 deletion tests_integration/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
class BaseIntegrationTestWithCache:
@pytest.fixture(autouse=True)
def setup(self) -> None:
return
# Base directory for all DSPy modules
library_dir = Path(__file__).resolve().parent
base_dir = library_dir.parent
Expand Down

0 comments on commit 0098e4e

Please sign in to comment.