From 71bf0112a30616ba1e9bc8e63400d8de01ba14cf Mon Sep 17 00:00:00 2001 From: KevKibe Date: Tue, 14 May 2024 11:43:00 +0300 Subject: [PATCH] refactor: move tests to one file --- .../test_google_pinecone_indexer.yaml | 29 ------------------- .../test_openai_pinecone_indexer.yaml | 29 ------------------- ...ohere_pinecone_indexer.yaml => tests.yaml} | 22 +++++++++++++- README.md | 4 +-- 4 files changed, 23 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/test_google_pinecone_indexer.yaml delete mode 100644 .github/workflows/test_openai_pinecone_indexer.yaml rename .github/workflows/{test_cohere_pinecone_indexer.yaml => tests.yaml} (53%) diff --git a/.github/workflows/test_google_pinecone_indexer.yaml b/.github/workflows/test_google_pinecone_indexer.yaml deleted file mode 100644 index 22fc4b9..0000000 --- a/.github/workflows/test_google_pinecone_indexer.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: GooglePineconeIndexer Tests - -on: [pull_request] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - pip install -r requirements.txt --no-cache-dir - pip install pytest einops lion-pytorch - - - name: Test with pytest - env: - PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - run: | - pytest src/tests/googleindex_test.py - \ No newline at end of file diff --git a/.github/workflows/test_openai_pinecone_indexer.yaml b/.github/workflows/test_openai_pinecone_indexer.yaml deleted file mode 100644 index 936472b..0000000 --- a/.github/workflows/test_openai_pinecone_indexer.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: OpenaiPineconeIndexer Tests - -on: [pull_request] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - pip install -r requirements.txt --no-cache-dir - pip install pytest einops lion-pytorch - - - name: Test with pytest - env: - PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - pytest src/tests/openaiindex_test.py - \ No newline at end of file diff --git a/.github/workflows/test_cohere_pinecone_indexer.yaml b/.github/workflows/tests.yaml similarity index 53% rename from .github/workflows/test_cohere_pinecone_indexer.yaml rename to .github/workflows/tests.yaml index b9d2432..ebb0712 100644 --- a/.github/workflows/test_cohere_pinecone_indexer.yaml +++ b/.github/workflows/tests.yaml @@ -20,10 +20,30 @@ jobs: pip install -r requirements.txt --no-cache-dir pip install pytest einops lion-pytorch - - name: Test with pytest + - name: Test CoherePineconeIndexer + id: cohere_test env: PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} run: | pytest src/tests/cohereindex_test.py + + + - name: Test OpenaiPineconeIndexer + id: openai_test + env: + PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + run: | + pytest src/tests/openaiindex_test.py + + + - name: Test GooglePineconeIndexer + id: google_test + env: + PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + run: | + pytest src/tests/googleindex_test.py + \ No newline at end of file diff --git a/README.md b/README.md index c54148a..436d0c7 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ cd src ```bash # Using OpenAI -python -m _openai.create_index --pinecone_api_key "your_pinecone_api_key" --index_name "your_index_name" - +python -m utils.create_index --pinecone_api_key "your_pinecone_api_key" --index_name "your_index_name" ``` @@ -164,7 +164,7 @@ python -m _cohere.index_documents --pinecone_api_key "your_pinecone_api_key" - ```bash # Using OpenAI -python -m _openai.delete_index --pinecone_api_key "your_pinecone_api_key" --index_name "your_index_name" +python -m utils.delete_index --pinecone_api_key "your_pinecone_api_key" --index_name "your_index_name" ```