Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
aorwall committed Jul 31, 2024
1 parent c46065a commit 63d9f92
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Poetry
Expand All @@ -21,33 +21,23 @@ jobs:
run: poetry install

- name: Cache REPO_DIR
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/repos
key: ${{ runner.os }}-repo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-repo-
- name: Cache INDEX_STORE_DIR
uses: actions/cache@v3
with:
path: /tmp/index-store
key: ${{ runner.os }}-index-store-${{ github.sha }}
restore-keys: |
${{ runner.os }}-index-store-
path: /tmp/cache
key: ${{ runner.os }}-moatless-${{ github.sha }}

- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
INDEX_STORE_URL: ${{ vars.INDEX_STORE_URL }}
INDEX_STORE_DIR: /tmp/index-store
INDEX_STORE_DIR: /tmp/cache/index-store
REPO_DIR: /tmp/cache/repos
MOATLESS_DIR: /tmp/moatless
REPO_DIR: /tmp/repos
run: poetry run pytest

- name: Upload MOATLESS_DIR contents
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ success() && hashFiles('/tmp/moatless/**') != '' }}
with:
name: moatless-artifacts
Expand Down
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def set_env_vars(monkeypatch, request):
logger.debug(f"Setting REPO_DIR={repo_dir}")
logger.debug(f"Setting MOATLESS_DIR={moatless_dir}")

if not os.path.exists(index_store_dir):
os.makedirs(index_store_dir)

if not os.path.exists(repo_dir):
os.makedirs(repo_dir)

if not os.path.exists(moatless_dir):
os.makedirs(moatless_dir)

monkeypatch.setenv("INDEX_STORE_DIR", index_store_dir)
monkeypatch.setenv("REPO_DIR", repo_dir)
monkeypatch.setenv("MOATLESS_DIR", moatless_dir)

0 comments on commit 63d9f92

Please sign in to comment.