From d9d3642ac95128fce3448d210ba4e8b39b36f6ec Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Sun, 21 Jan 2024 08:43:46 -0800 Subject: [PATCH 1/3] Restructure testing --- .github/workflows/python-tests.yaml | 10 ++++------ Makefile | 18 ++---------------- README.md | 8 -------- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 9262ba8..f8ac84b 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -14,8 +14,6 @@ jobs: test: runs-on: ubuntu-latest defaults: - run: - working-directory: ./python-sdk if: contains(github.event.pull_request.labels.*.name, 'okay-to-test') || (github.event_name == 'push') steps: @@ -39,14 +37,14 @@ jobs: with: path: .venv key: venv-dev-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - name: Install Dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - make install-dev - name: Install server dependencies # The python tests spin up a server instance if it's not already running. run: | make init-server + - name: Install Dependencies + run: | + make install-dev + - name: Run tests env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/Makefile b/Makefile index 5da8c33..bf1772c 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,7 @@ .PHONY: test lint format test: - cd python-sdk; pytest tests/ - -lint: - cd python-sdk; black rebuff/ tests/ - cd python-sdk; flake8 rebuff/ tests/ - cd python-sdk; isort rebuff/ tests/ - cd python-sdk; mypy rebuff/ tests/ - -format: - cd python-sdk; isort rebuff/ tests/ - cd python-sdk; black rebuff/ tests/ + cd python-sdk; make-install-dev; make test init-python-sdk: cd python-sdk; make install-dev @@ -22,8 +12,4 @@ init-js-sdk: cd javascript-sdk; npm install init-server: - cd server; npm install - -publish-python-sdk: - cd python-sdk; python-sdk setup.py sdist bdist_wheel - cd python-sdk; twine upload dist/* \ No newline at end of file + cd server; npm install \ No newline at end of file diff --git a/README.md b/README.md index fdcba4d..f41d0a9 100644 --- a/README.md +++ b/README.md @@ -188,11 +188,3 @@ To set up the development environment, run: ```bash make init ``` - -To run tests, linting, and formatting, use the following commands: - -```bash -make test -make lint -make format -``` From 8ca6c9154932ed45b7758e97950b77acba93c91b Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Sun, 21 Jan 2024 08:46:06 -0800 Subject: [PATCH 2/3] Restructure testing --- .github/workflows/python-tests.yaml | 12 +----------- Makefile | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index f8ac84b..f5d0ea8 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -31,20 +31,10 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true installer-parallel: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-dev-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install server dependencies - # The python tests spin up a server instance if it's not already running. + # Spin up a server instance for testing against run: | make init-server - - name: Install Dependencies - run: | - make install-dev - - name: Run tests env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/Makefile b/Makefile index bf1772c..57f20b0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: test lint format test: - cd python-sdk; make-install-dev; make test + cd python-sdk; make install-dev; make test init-python-sdk: cd python-sdk; make install-dev From a5f37571d657ac24c3a05333bf4aba934b388723 Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Sun, 21 Jan 2024 08:50:02 -0800 Subject: [PATCH 3/3] Fix --- .github/workflows/python-tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index f5d0ea8..33b7c74 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -13,7 +13,6 @@ on: jobs: test: runs-on: ubuntu-latest - defaults: if: contains(github.event.pull_request.labels.*.name, 'okay-to-test') || (github.event_name == 'push') steps: