From 0098e4e74316924d7fbf6717e2c20ac06f5be1b0 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Sat, 25 May 2024 13:07:52 -0600 Subject: [PATCH] feat(tests): cache file. --- .github/workflows/run_tests.yml | 63 +++++++++++++++------------------ tests_integration/base.py | 1 - 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 6c1ddf576..46a1f676b 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -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/ diff --git a/tests_integration/base.py b/tests_integration/base.py index abdc81f4d..ef079d9e3 100644 --- a/tests_integration/base.py +++ b/tests_integration/base.py @@ -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